texts: Display label & block if associated product count is greater than 1?

texts:
I am running Magento 1.9.1 and I have created a block to display a "More Colours" label on the category page in each product's block but I would like this label to only display when the associated (simple) product count for the configurable product is greater than 1. In other words, if more than one colour is available; show the "More Colours" label.

I tried the below code, with the first if statement being the code I added to the original file in order to accomplish this, but to no avail, if anyone could point me in the right direction, it would be greatly appeciated.

$_product    = $this->getProduct();
$_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
<?php
$usedProductIds = $_product->getTypeInstance()->getUsedProductIds();
if(count($usedProductIds)>1);?>
<?php if ($_product->isSaleable() && count($_attributes)):?>

<?php foreach($_attributes as $_attribute): ?>
    <dt id="label-<?php echo $_attribute->getAttributeId() ?>-<?php echo $_product->getEntityId() ?>">More Colours

    <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>

            <select name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>-<?php echo $_product->getEntityId() ?>" class="required-entry super-attribute-select-<?php echo $_product->getEntityId() ?>">
                <option><?php echo $this->__('Choose an Option...') ?></option>
            </select>

          <div id="requared-attribute<?php echo $_attribute->getAttributeId() ?>-<?php echo $_product->getEntityId() ?>" style="color:red">

<?php endforeach; ?>


texts: Submenus NOT working in Magento 2 Admin>Configuration Panels

texts:
Anyone know how to fix a brand new fresh install of Magento 2.1 when instantly upon installing NONE of the panels are expanding in Admin System Configuration??
Kinda hard to setup a store when a fresh new install has an immediate problem that doesn't even allow setup.


texts: unknown protocol error in connection to repo.magento.com:443

texts: I get the following error after downloading the cacert.pem file from https://curl.haxx.se/ca/cacert.pem   and adding curl.cainfo=C:/xampp/Apache/cacert.pem  in php.ini file


texts: How to rewrite /lib/web/magnifier/magnifier.js file in a custom module in magento 2.3?

texts:
Can we rewrite files in the lib folder?

If we can, I want to know how to rewrite /lib/web/magnifier/magnifier.js file in a custom module.


texts: Implementing GTM in multistore environment

texts:
Hi we are implementing Google Tag Manager (GTM) in our Magento store. We have a multistore environment /w 3 storenames & 2 views per stores (languages), making it 6 storeviews in total.

And that got me thinking during the GTM set-up process. Question: Does one set-up multiple accounts, or multiple containers (per storeview), or just 1 container to cover all stores? Using the multiple accounts and multiple containers method seemed like a lot of manual config.

fyi. we now started the 1 container solution. And created a macro lookup table per hostname returning for example the GUA ID. This way we have 1 rule that serves many storeviews.

How are other multistore owners running this?

Many thanks, Sean


texts: Jasmine Grunt Spec PhantomJS Error on Magento 2

texts:
I am having problems with PhantomJS. When I try to do a Jasmine Test. This is my first time running Jasmine.

Things I did prior:

Installed Grunt
Executed grunt spec:backend

Do check my terminal logs

grunt spec:backend
Running "spec:backend" (spec) task

Running "connect:backend" (connect) task
Started connect web server on http://0.0.0.0:8000

Running "jasmine:backend" (jasmine) task
Testing jasmine specs via PhantomJS

PhantomJS threw an error:ERROR
>> 0 [ '' ]
Warning: PhantomJS exited unexpectedly with exit code null. Use --force to continue.

Aborted due to warnings.

Execution Time (2017-11-30 06:19:08 UTC+8)
loading tasks                  403ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 33%
spec:backend                   243ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 20%
loading grunt-contrib-connect  136ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 11%
connect:backend                 40ms  ▇▇▇▇▇▇ 3%
loading grunt-contrib-jasmine   72ms  ▇▇▇▇▇▇▇▇▇▇▇ 6%
jasmine:backend                339ms  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 27%
Total 1.2s


texts:
How to disable payment method

  Check / Money Order

only on frontend, but left available for admin on backend ?

I can't find solution for M2


texts: Magento 2 Multiple Nodes Clear non-FP caches

texts:
Considering a multi-node setup where there is a single Varnish server for load balancing and multiple Magento servers (Apache and Magento on each), what is the recommended setup so that using Admin (which runs on it's own server again) and clearing a non-FP cache (ie Blocks Output Cache) so that all other nodes also clear their local respective cache in /var folder?

Read somewhere that a shared NFS folder for /var is one option, but wouldn't that cause collisions (write I/O)?

Also read somewhere you can have Redis setup for this but we understand that Redis is an "or" case with Varnish. We are already using Varnish.


texts: In magento2 - I would like to understand what populates data in cataloginventory_stock_status table and from which table the data is transferred in this table. I tried searching in cataloginventory_stock_item but the data in both table is not matching for stock_status and is_in_stock fields.


texts: I have an order id. On basis of that I need to send the already created invoice to the customer.


texts:
We are looking to start using testing for our builds and are looking at the best tools to use. I noticed there is a port of the Magento 2 tests https://github.com/techdivision/TechDivision_MagentoUnitTesting and had a bit of play around last night. There are a lot of skipped tests but it did work. I like the idea that we would be writing tests in the same way that Magento is heading, but I'm concerned that it's either going to change or the backport's missing functionality means it's not worthwhile.

Is it a good idea to use Magento 2 tests or would it be more beneficial to go with the Ecomdev PHPUnit? Are there any recommendations for other types of testing?


texts: Update programmatically config content text/x-magento-init script inside of phtml template

texts:
For a requirement I had to override the config of the configurable.js script that is initialised inside configurable.phtml, this one specifically:

<script type="text/x-magento-init">
        {
            "#product_addtocart_form": {
                "configurable": {
                    "spConfig": <?= /* @escapeNotVerified */ $block->getJsonConfig() ?>,
                    "gallerySwitchStrategy": "<?php /* @escapeNotVerified */ echo $block->getVar('gallery_switch_strategy',
                        'Magento_ConfigurableProduct') ?: 'replace'; ?>"
                }
            }
        }
    </script>

I did so with a plugin using the afterGetJsonConfig method and adding my data to that spConfig after loading the template with ajax. Everything looks good when calling the template the first time, but I need to change and keep those changes to the configuration of the component after a validation via an ajax call. The problem is that, because the template is cached, it will always return the initial content.

This is confirmed by the fact that if I disable block_html cache the content is updated correctly and if I turn the cache on it doesn't and it doesn't even call then afterGetJsonConfig method on successive page reload. Is there a way to force disable the cache or get the most updated content and retain it without being forced to disable the cache for the whole page?


texts: getting null in customer email Magento 2 Custmer session

texts:
Edit.php (block)

class Edit extends \Magento\Framework\View\Element\Template
{

    protected $request;

    protected $customerSession;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        array $data = [],
        \FM\Quick\Model\QuickFactory $modelFactory,
        \Magento\Customer\Model\Session $customerSession,
        \Magento\Framework\App\Request\Http $request

    ) {
        parent::__construct($context,$data);
        $this->_modelFactory = $modelFactory;
         $this->request = $request;
        $this->customerSession = $customerSession;

    }

    public function getIddata()
    {
        $this->request->getParams();
        return $this->request->getParam('id');
    }

    public function getCollection(){

        $id=$this->getIddata();
        $customer_email=$this->getCustomer();  //here i'm getting null

        $d=$this->_modelFactory->create();
        return $d->getCollection()->addFieldToFilter('quick_id',$id);

    }

    public function getCustomer()
    {
        $customerData=$this->customerSession->getCustomer();

        return $customerData->getEmail();

    }

}

  $customer_email=$this->getCustomer();  //here i'm getting null

  getting null on this variable

  why is not getting customer email in Magento 2?


texts: Magento 2 cookies not working when all cache is enabled

texts:
In an observer I'm setting a cookie like this:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cookieManager = $objectManager->get('Magento\Framework\Stdlib\CookieManagerInterface');

$cookieManager->setPublicCookie('myvar', $myVar);

Everything is working when Full page caching is disabled. However, once I enable it, the cookie won't be set.

How can I fix this?


texts: Error in magento admin panel : Source model "marketplace/catalog_product_attribute_status" not found for attribute "product_status"

texts:
I am getting error as

  'Source model "marketplace/catalog_product_attribute_status" not found
  for attribute "product_status"'

after click on product in manage product section of magento admin panel.

Does anyone has gone through same error.

Solution : Disabled the module from admin panel and also from xml file resolved the issue


texts:
We have some coupons that make an order's value be zero. Thus they checkout with the Zero Subtotal Payment method. We can make the Zero Subtotal Payment method make orders Pending or Processing with automatic invoicing. Problem comes when we want to cancel the order after the order has been invoiced.

Normally we can just refund the credit card and cancel the order. But Zero Subtotal has no refund method and disables the cancel button.

Is this a bug or is there really no way to not ship an order thats been marked processing by the Zero Subtotal Payment method.

This is extremely problematic when we edit an order, which creates a new ###-1 order and gives us no way to cancel the original.


texts: I am creating custom cache type but its not appearing in Cache Management section magento2

texts:
I have created cache.xml inside app/code/Custom/CacheType/etc/cache.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Cache/etc/cache.xsd">
    <type name="ansar" translate="label,description" instance="Custom\CacheType\Model\Cache\Type">
        <label>Custom Type Cache</label>
        <description>Custom types cache</description>
    </type>
</config>

And i have created Model file in location Custom/CacheType/Model/Cache/Type.php

<?php

namespace Custom\CacheType\Model\Cache;

class Type extends \Magento\Framework\Cache\Frontend\Decorator\TagScope
{
    const TYPE_IDENTIFIER = 'ansar';

    const CACHE_TAG = 'ANSAR';

    public function __construct(\Magento\Framework\App\Cache\Type\FrontendPool $cacheFrontendPool)
    {
        parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG);
    }
}

Buts its not displaying in admin section cache management.


texts:
I'm trying to get Visitor Id of customer after customer registration success, and using event customer_register_success for this purpose. But this event may called earlier I think, because if I print data from log_customer table in this event, it doesn't show me the log record for the last current customer. But record is getting added to database. please suggest the right event to do the job done.

EDIT :

Just realized that customer log is getting updated in visitor _aftersave function

if ($this->_urlLoggingCondition->isLogEnabled()) {
    $this->_saveVisitorUrl($visitor);
    if ($visitor->getDoCustomerLogin() || $visitor->getDoCustomerLogout()) {
        $this->_saveCustomerInfo($visitor);
     }
}

But its called after customer_login so can't get it through this event & none of the other event is called after that (or I haven't fount one ?)


texts:
I have a tablerates.csv containing my postcodes range along with weight and price.

For ex:
weight = 1 then price = 10
weight = 2 then price = 15

The above is working for me, but I have a requirement where I need to set Free Shipping for products with weight 0.

weight = 0 then price = 0

I have added the code in csv for the same, but its not reflecting somehow.

Pls help.

Thanks.


texts: How can i retrieve order info (sku's of products, price of products, total, etc) from success page in a phtml file to put in a script in

texts:
I need to retrive data from an order, on success page, this info is dynamic and i need to create a script for Dynamic Re-marketing Implementation. This is the script that has to be put after  tag in success page, after an order is placed. And i need to retrieve the dynamic info for every order. I managed to include this scripts on cart, on product single page, but on success page it's not working.
this is the script
<script>
    var dataLayer = window.dataLayer || [];

    dataLayer.push({

    'event': 'fireRemarketingTag',

    'google_tag_params': {

    'ecomm_prodid': '[product_id]',

    'ecomm_pagetype': '[page_type]',

    'ecomm_totalvalue': [product_price]

    }

    });
    </script>

In Magento_Checkout/layout/checkout_onepage_success.xml i've added the code to include the phtml file:
 <referenceContainer name="head.additional">
            <block class="Magento\Framework\View\Element\Template" name="google.adw" before="-" template="Magento_Checkout::googleadw.phtml" />
        </referenceContainer>

This is the phtml file that i've added googleadw.phtml
<?php
$orderId = $this->getOrderId();
$objectManager =  \Magento\Framework\App\ObjectManager::getInstance();
$orderData = $objectManager->create('\Magento\Sales\Model\OrderRepository')->get($orderId);
$total = $orderData->getGrandTotal();
$skus = '';
foreach($orderData->getAllItems() as $item) {
    $skus .=  $item->getSku() . ',';
  }
$skus = trim($skus, ',');
?>
<script>

var dataLayer = window.dataLayer || [];

dataLayer.push({

'event': 'fireRemarketingTag',

'google_tag_params': {

'ecomm_prodid': "<?php echo $skus; ?>",

'ecomm_pagetype': "purchase",

'ecomm_totalvalue': "<?php echo $total;?>"

}

});

</script>

The script is placing correctly in  but i have an error and can t retrieve data of order.
In cart page, I have access to this info, this is the code for the cart page, and there it's working
 <?php

 $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');

// retrieve quote items collection
$itemsCollection = $cart->getQuote()->getItemsCollection();

// get array of all items what can be display directly
$itemsVisible = $cart->getQuote()->getAllVisibleItems();

// retrieve quote items array
$items = $cart->getQuote()->getAllItems();
$skus = '';
$prices = '';
$quantity = '';
foreach($items as $item) {
  //  echo 'ID: '.$item->getProductId().'<br />';
  $quantity = $item->getQty();
   $prices += $item->getPrice() * $quantity;
   $skus .=  $item->getSku() . ',';
  }
  $skus = trim($skus, ',');

?>
<script>

var dataLayer = window.dataLayer || [];

dataLayer.push({

'event': 'fireRemarketingTag',

'google_tag_params': {

'ecomm_prodid': "<?php echo $skus; ?>",

'ecomm_pagetype': "cart",

'ecomm_totalvalue': "<?php echo $prices;?>"

}

});

</script>

there is a difference here, I retrieve the subtotal, not the total, by summing the products with their quantities,but for skus is the same logic.
This is the error i get on succes page
1 exception(s):
Exception #0 (Magento\Framework\Exception\InputException): Id required

Exception #0 (Magento\Framework\Exception\InputException): Id required
#0 /var/www/vhosts/myorganic.ro/staging.myorganic.ro/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Sales\Model\OrderRepository->get(NULL)
#1 /var/www/vhosts/myorganic.ro/staging.myorganic.ro/var/generation/Magento/Sales/Model/OrderRepository/Interceptor.php(26): Magento\Sales\Model\OrderRepository\Interceptor->___callPlugins('get', Array, Array)

So i think that the id it s not retrived, that s why it doesn t work.
Can you please help me?


texts: How to reset life sales=0 in Magento dashboard?

texts:
I have run below-listed queries:

SET FOREIGN_KEY_CHECKS = 0;

TRUNCATE TABLE `gift_message`;
TRUNCATE TABLE `quote`;
TRUNCATE TABLE `quote_address`;
TRUNCATE TABLE `quote_address_item`;
TRUNCATE TABLE `quote_id_mask`;
TRUNCATE TABLE `quote_item`;
TRUNCATE TABLE `quote_item_option`;
TRUNCATE TABLE `quote_payment`;
TRUNCATE TABLE `quote_shipping_rate`;
TRUNCATE TABLE `reporting_orders`;
TRUNCATE TABLE `sales_bestsellers_aggregated_daily`;
TRUNCATE TABLE `sales_bestsellers_aggregated_monthly`;
TRUNCATE TABLE `sales_bestsellers_aggregated_yearly`;
TRUNCATE TABLE `sales_creditmemo`;
TRUNCATE TABLE `sales_creditmemo_comment`;
TRUNCATE TABLE `sales_creditmemo_grid`;
TRUNCATE TABLE `sales_creditmemo_item`;
TRUNCATE TABLE `sales_invoice`;
TRUNCATE TABLE `sales_invoiced_aggregated`;
TRUNCATE TABLE `sales_invoiced_aggregated_order`;
TRUNCATE TABLE `sales_invoice_comment`;
TRUNCATE TABLE `sales_invoice_grid`;
TRUNCATE TABLE `sales_invoice_item`;
TRUNCATE TABLE `sales_order`;
TRUNCATE TABLE `sales_order_address`;
TRUNCATE TABLE `sales_order_aggregated_created`;
TRUNCATE TABLE `sales_order_aggregated_updated`;
TRUNCATE TABLE `sales_order_grid`;
TRUNCATE TABLE `sales_order_item`;
TRUNCATE TABLE `sales_order_payment`;
TRUNCATE TABLE `sales_order_status_history`;
TRUNCATE TABLE `sales_order_tax`;
TRUNCATE TABLE `sales_order_tax_item`;
TRUNCATE TABLE `sales_payment_transaction`;
TRUNCATE TABLE `sales_refunded_aggregated`;
TRUNCATE TABLE `sales_refunded_aggregated_order`;
TRUNCATE TABLE `sales_shipment`;
TRUNCATE TABLE `sales_shipment_comment`;
TRUNCATE TABLE `sales_shipment_grid`;
TRUNCATE TABLE `sales_shipment_item`;
TRUNCATE TABLE `sales_shipment_track`;
TRUNCATE TABLE `sales_shipping_aggregated`;
TRUNCATE TABLE `sales_shipping_aggregated_order`;
TRUNCATE TABLE `tax_order_aggregated_created`;
TRUNCATE TABLE `tax_order_aggregated_updated`;

ALTER TABLE `sales_order` AUTO_INCREMENT=1;

SET FOREIGN_KEY_CHECKS = 1;

The system doesn't allow me to truncate.

TRUNCATE TABLE `Mp_sales_creditmemo`;
TRUNCATE TABLE `Mp_sales_invoice`;
TRUNCATE TABLE `Mp_sales_order`;
TRUNCATE TABLE `Mp_sales_order_address`;
TRUNCATE TABLE `Mp_sales_order_item`;
TRUNCATE TABLE `Mp_sales_order_payment`;
TRUNCATE TABLE `Mp_sales_order_tax`;
TRUNCATE TABLE `Mp_sales_shipment`;
TRUNCATE TABLE `Mp_quote`;
TRUNCATE TABLE `Mp_quote_address`;
TRUNCATE TABLE `Mp_quote_item`;

Still, I can't reset the life time sales of Magento 2 dashboard


texts: Magento2 Chrome Driver Service error in MTF

texts:
I am new to MTF. I have followed the magento2 tutorial based on the following link
But When I am running the command
vendor/bin/phpunit

I am getting the following error -

Fatal error: Uncaught
PHPUnit_Extensions_Selenium2TestCase_WebDriverException: nable to
create new service: ChromeDriverService Build info: version: '3.14.0',
revision: 'aacccce0', time: '2018-08-02T20:13:22 693Z' System info:
host: 'WTW-HP', ip: '192.168.0.31', os.name: 'Windows 7', os.arch:
'amd64', os.version: '6.1', java.version: '10.0.2'
Driver info: driver.version: unknown in
C:\wamp64\www\magento2252\dev\tests\func
tional\vendor\phpunit\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driv
er.php:165 Stack trace:
0 C:\wamp64\www\magento2252\dev\tests\functional\vendor\phpunit\phpunit-seleniu
m\PHPUnit\Extensions\Selenium2TestCase\Driver.php(71):
PHPUnit_Extensions_Seleni um2TestCase_Driver->curl('POST',
Object(PHPUnit_Extensions_Selenium2TestCase_URL ), Array)
1 C:\wamp64\www\magento2252\dev\tests\functional\vendor\phpunit\phpunit-seleniu
m\PHPUnit\Extensions\Selenium2TestCase\SessionStrategy\Isolated.php(67):
PHPUnit
_Extensions_Selenium2TestCase_Driver->startSession(Array, Object(PHPUnit_Extensi ons_Selenium2Test in
C:\wamp64\www\magento2252\dev\tests\functional\vendor\phpun
it\phpunit-selenium\PHPUnit\Extensions\Selenium2TestCase\Driver.php on
line 165

My goal is to learn the MTF and integrate the tests in My custom module


texts: Magento 2.2 - Uncaught TypeError: jQuery(...).autocomplete is not a function

texts:
Jquery UI autocomplete is not working. Refer the attachment.

Please help me to sort out this.


texts: when I enable the SSL i got the following error and indexing search can any one now about this error


texts: How can i get phtml file in helper magento 2?

texts:
I have tried this solution but it is not working

$this->_layout->createBlock('Vendor\Module\Block\Productdesigner');
       $response = $layout->setData(array("customer_data" => $result))->setTemplate('Vendor_Module::test.phtml')->toHtml();

get an error when i have used above solution

Invalid template file: 'Vendor_Module::test.phtml' in module: 'Vendor_Module' block's name: 'productdesigner_0

I have add phtml file in below path

app/code/Vendor/Module/view/frontend/templates/test.phtml


texts: Magento 2.3 add delivery date filter in sales report

texts: I've to add custom delivery date filter in sales order report. Does anyone having any idea about it?


texts:
I added simple product with options programmatically into cart using this code.

namespace Vendor\Extension\Controller\Customer;

class Myclass extends \Magento\Framework\App\Action\Action
{
    protected $messageManager;
    protected $custsession;
    protected $_responseFactory;
    protected $_url;
    protected $_appRequestInterface;

    public function __construct(\Magento\Framework\App\Action\Context $context,
    \Magento\Customer\Model\Session $custsession,
    \Magento\Framework\App\ResponseFactory $responseFactory,
    \Magento\Framework\UrlInterface $url,
    \Magento\Framework\App\RequestInterface $appRequestInterface,
    \Magento\Framework\Message\ManagerInterface $messageManager)
    {
        $this->custsession = $custsession;
        $this->_responseFactory = $responseFactory;
        $this->_url = $url;
        $this->_appRequestInterface = $appRequestInterface;
        $this->messageManager = $messageManager;
        parent::__construct($context);
    }

    public function execute()
    {
        if($this->custsession->isLoggedIn())
        {
            try
            {
                $params = [
                          'product' => 12,
                          'selected_configurable_option' => NULL,
                          'related_product' => NULL,
                          'options' => [
                              3 => 8,
                          ],
                          'qty' => 2
                ];

                $product = $om->create('Magento\Catalog\Model\Product')->load(12);
                $mycartp = $om->get('Magento\Checkout\Model\Cart');
                $mycartp->addProduct($product,$params);
                $mycartp->save();

                $quote = $om->get('Magento\Quote\Model\Quote');
                $quote->setTotalsCollectedFlag(false)->collectTotals()->save();

                $checkout = $om->get('Magento\Checkout\Model\Session');
                $checkout->getQuote()->collectTotals()->save();

                $message = "Your quote has been successfully added to cart";
                $this->messageManager->addSuccess($message);

                $accUrl = $this->_url->getUrl('checkout/cart/');
                $this->_responseFactory->create()->setRedirect($accUrl)->sendResponse();
                exit;

            }
            catch(\Exception $e)
            {
                $this->messageManager->addError($e->getMessage());
                $accUrl = $this->_url->getUrl('extension/controller/mypage');
                $this->_responseFactory->create()->setRedirect($accUrl)->sendResponse();
                exit;
            }
        }
        else
        {
            $accUrl = $this->_url->getUrl('customer/account/login');
            $this->_responseFactory->create()->setRedirect($accUrl)->sendResponse();
            exit;
        }
    }
}

The product sucessfully added to cart with options, but it not show correct subtotal in cart page and mini-cart. See below screen-sort.

One's I click on "Update Shopping Cart" it show correct total. See below screen-sort.

Any one know about this?


texts: How to increase page view to 500 on Sales Order Grid

texts:
Mage 1.7.0.2 CE

I am having a problem updating the grid.php to increase the default limit which is currently at 200. I have edited the grid.phtml file to display 500 in the dropdown on the Sales Order Grid but I can't get it to work, it just loads the dashboard of Mage when I click on it.

So I'm pretty sure I need to edit the grid.php here:

/app/code/local/Mage/Adminhtml/Catalog/Product/Grid.php

To allow for an increase in the default limit. However when I add this:

public function __construct()
{
    parent::__construct();
    $this->setDefaultLimit(100);

It breaks Mage with a 500 error.

So I'd like to know what I need to do to override the default limit of 200, so I can increase it to 500. It's important since my employer uses the sales order grid to process orders.

Thanks~


texts:
Read this fully guys please

While I was checking in Google for changing the theme I got this blog (click this link) for installing new theme in the second part of this blog there was a heading "

  How To Install A Downloaded Magento Theme

under the heading in the second paragraph

2. Copy entire app folder of your new theme under Your_Magento_Installation/app/design/frontend/default/ so it becomes like Your_Magento_Installation/app/design/frontend/default/new_theme

3. Copy entire skin folder of your new theme under Your_Magento_Installation /skin/frontend/default/ so it becomes like Your_Magento_Installation/ skin/frontend/default/ new_theme

there will be another default theme i.e. folder of magento
what should i do now....

new theme i.e. the downloaded also has folders app and skin so
the folder structure will be like for downloaded ex: shoestore/app/ and shoestore/skin

do you mean that i should copy the entire folder app from downloaded theme and put it in this folder C:\xampp\htdocs\magento\app\design\frontend\default

as it becomes like C:\xampp\htdocs\magento\app\design\frontend\default\app\design\frontend\default

I cannot understand what he really mean?

*****Can anyone explain me
or can anyone suggest me how to install a new downloaded or
can prefer me any link*****


texts: Does setup:upgrade command includes the reindexing commands in itself

texts:
In magento2 - setup:upgrade command which is generally very fast, is taking a lot of time which has made me to see it suspiciously.

Indexers are all set on update On Schedule and when setup:upgrade command reaches at Magento_Indexer module it takes a lot of time to get over it probably equals to the time when indexers are run from command line.

I know upgrade commands clears a lot of code generated folders of magneto but seems like indexers are also included in version 2.3.2

Any response is very helpful?


texts: Redirecting Associated Products to Grouped Product

texts:
I have been expanding my catalog and have run into a few suppliers that are carrying the exact same products. The only difference is the price and stock levels.

To avoid duplicate products on my website (and search engine penalties), I've created a Grouped Product with the name of the product and have added the 2 identical products from the 2 different suppliers and have set them to "Not visible individually"

The problem I now face is that by setting the Associated Products to "Not visible individually" is that the link becomes dead.

What I would like to do is to automatically create a redirect to the Grouped Product for all Associated Products

How do you create redirects of Associated Products to the Grouped Product ?


texts: Create Product Configurations Page Empty After Upgrade to 2.1.6

texts:
Preconditions

Magento 2.1.6 & PHP 7.0.18

Steps to reproduce

Go to add new product in catalog
Click on create configurations in the configurations section
Page will show empty for the bottom half with the buttons showing up on
the top

Expected result

First step is selecting the attribute value

Actual result

My screenshot of what I see

Steps I have taken to try to fix this:

Ran setup:static-content:deploy
Cleared and flushed cache
Disabled cache

(No errors at all in the exception log or in the developer console)


texts: How to get Magento 2 latest version number available?

texts:
Magento 1 was here:
http://connect20.magentocommerce.com/community/Mage_All_Latest/releases.xml

Where is Magento 2?


texts: I just upgrade from magento default theme to Solwin-freego theme, everything seems to be ok except that my category section is not displayed correctly since the update to the new theme.


texts: System-specific env.php values are included in database config snapshot

texts:
I have an instance of Magento 2.2.3 on my development server, and my env.php file includes the following:

'system' =>
  array (
    'default' =>
      ...
      'web' =>
      array (
        'unsecure' =>
        array (
          'base_url' => 'https://my.dev.site/',
          'base_link_url' => '{{unsecure_base_url}}',
        ),
        'secure' =>
        array (
          'base_url' => '{{unsecure_base_url}}',
          'base_link_url' => '{{secure_base_url}}',
        ),
        'default' =>
        array (
          'front' => 'cms',
        ),
      ),
...

This env.php file is not versioned. My config.php file is versioned. However, when I run setup:upgrade or app:config:import, all 'system' values in env.php are merged with config.php's values, and stored in system_config_snapshot in the database's flag table.

This causes a 500 Internal Server Error when my colleague on a different server attempts to use her instance of Magento. The base_url in the configuration snapshot does not match her config, so she is forced to upgrade or import; which in turn causes my server to crash since my config no longer matches the snapshot.

My understanding of the env.php file is that it is system-specific, so I'm not sure why this one section of the file ('system') is getting extracted and merged with config.php's values in the database's config snapshot. Does anyone have any ideas?


texts: Prevent throw a report phtml error. I need "try and catch" and still working

texts:
I've created a module to connect with an external API to know the shipping price. It works fine and I show the prices in the product page view.

The problem is when the API connection fails magento is throwing a report 503 phtml. I need to capture this error, show the product and disable "add to cart" button.

I think I need something like:

try {
   Connect   ( Problem here, it's throwing 503 page.
   show shipping price

}
catch (Exception $e){
  create report file
  Disable button and show one message.
}

The Code:

If the connection to the API fails, I get redirected to " report.phtml " I do not want this to happen.

$url_soap = "http://xxxxxx.com.co:89/xxxxxxxxx/xxxxxxxxx.asmx?WSDL";
$soap = new SoapClient($url_soap,
    array(
        "location" => "http://xxxxxx.com.co:89/xxxxxxxx/xxxxxxx.asmx",
    )
);

$parameters = array(
    'Client' => $customerId,
    'From' => '$from,
    'To' => $to,
    'Units' => $units,
    'Weight' => $weight_value,
    'Value' => $price,
    'Width' => $width_value,
    'Height' =>  $height_value,
    'Length' => $length_value
    );

If this fails redirect me to report.phtml ( I don't want this  I want still in product view. )

$cot = $soap->MakePrice($parameters);

$shipping_price = $cot->MakePriceResult->Price;
....

If the connection to the API fails, I get redirected to " report.phtml " I do not want this to happen. I want to continue and check thinks like this:

if(!$shipping_price){
    echo "This product is not available for you";
}else {
    echo Mage::helper('core')->formatPrice($shipping_price, true);
}


texts: add similar text under description for all 1000 products at once

texts:
we have 5000 products in site

we have 5 attribute-set , each attribute have 1000 products each.

for products of only one attribute set, under description tab,
we have to add this text " color may vary as shown in above image"

how we can achieve this for only one attribute-set products.

we don't want this text for other attribute-set products


texts: How to add JS and CSS calling in PHTML file?

texts:
I am including JS validations in Magento, there respected .js and .css files included like:

  app/design/frontend/Smartwave/porto/Smartwave_Porto/layout/default.xml

<css src="Smartwave_Porto::css/index.css"/>
<script src="Smartwave_Porto::js/index.js"/>

and include those css, js files in :

  app/design/frontend/Smartwave/porto/Smartwave_Porto/web/css and js

I have created a CMS Page and call the test.phtml file in cms page

I want to include css and js files in the test.phtml file but I cant.

Explain how to inlude those css and js files in .phtml file
Location of .phtml file:

  app/design/frontend/Smartwave/porto/Smartwave_Porto/templates/test.phtml

Thanks!


texts: Magento 2 Addtocart Group product programatically

texts:
I am facing the problem with the Addtocart group product. Can anyone suggest me the code? I have tried as a simple product but it's not working as well try with below code but that did not work out for me.

  $params = array('product' => $key,'super_group' => $super_group);

Can anyone please suggest the format of addtocart group product.
Thank you in Advanced


texts:
i am using magento enterprise edition, i have created a module to add custom attributes to the categories , the attributes are visible in adminhtml and they are saved propertly but when i try to retrieve the category on frontend, it doesnot contain the attributes i just created and i alredy reindex all but nothing, the problem is magento enterprise because i tried in magento community and works fine, here is my code

   $installer = Mage::getResourceModel('catalog/setup','catalog_setup');
    $installer->startSetup();
    $label="whatever";

 $installer->addAttribute('catalog_category', $label, array(
                   'type' => 'int',
                   'label' => $label,
                   'input' => 'select',
                   'source'  => 'eav/entity_attribute_source_boolean',
                   'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
                   'visible' => true,
                   'required' => false,
                   'default' => '0',
                   "visible_on_front"  => true,
                   'group' => 'filter9',
               ));

here is the config file

 <?xml version="1.0"?>
 <config>

 <modules>
     <Qxd_Categories>
         <version>0.0.6</version>
     </Qxd_Categories>
 </modules>
         <admin>
             <routers>
                 <adminhtml>
                    <args>
                    <modules>
                             <Qxd_Categories before="Mage_Adminhtml">Qxd_Categories_Adminhtml</Qxd_Categories>
                         </modules>
                    </args>
                </adminhtml>
            </routers>
        </admin>

<global>
    <resources>
        <qxd_categories_setup>
            <setup>
                <module>Qxd_Categories</module>
                <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </qxd_categories_setup>
        <qxd_categories_setup_write>
            <connection>
                <use>core_write</use>
            </connection>
        </qxd_categories_setup_write>
        <qxd_categories_setup_read>
            <connection>
                <use>core_read</use>
            </connection>
        </qxd_categories_setup_read>
    </resources>
</global>

 </config>

And this is front end where i am trying to  reindex data and retrieve the category:

 $categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('*');
 $process = Mage::getModel('index/process')->load(5);   $process->reindexAll();
  $process = Mage::getModel('index/process')->load(6);    $process->reindexAll();
 foreach ($categories as $category) {

$cat = Mage::getModel("catalog/category")->load($category->getId());
if($cat->getData('entity_id')=='7'){
        var_dump($cat->getData()); // all but my attribute
        var_dump($cat); // my attribute is not there :(

        var_dump($cat->getName()); // My  Category Name
     }

 }

Any suggestion is welcome, please help me!!


texts:
Apparently I've found a bug in Magento 1.7.0.2, 1.8.0.0 and 1.8.1.0

I'm creating an order on frontend with 2 different products. Qty ordered is greater than 1 for both products. Last test on 1.8.1.0 was with 2 simple products.
I invoice in admin only 1 product.
Than I click Credit Memo button and I get this:

The warning is from 1.8.1.0.

Warning: Division by zero  in app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php on line 266

#0 app/code/core/Mage/Sales/Model/Order/Creditmemo/Item.php(266): mageCoreErrorHandler(2, 'Division by zer...', '/nethosting/mag...', 266, Array)
#1 app/code/core/Mage/Sales/Model/Order/Creditmemo/Total/Subtotal.php(48): Mage_Sales_Model_Order_Creditmemo_Item->calcRowTotal()
#2 app/code/core/Mage/Sales/Model/Order/Creditmemo.php(330): Mage_Sales_Model_Order_Creditmemo_Total_Subtotal->collect(Object(Mage_Sales_Model_Order_Creditmemo))
#3 app/code/core/Mage/Sales/Model/Service/Order.php(240): Mage_Sales_Model_Order_Creditmemo->collectTotals()
#4 app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php(138): Mage_Sales_Model_Service_Order->prepareCreditmemo(Array)
#5 app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php(222): Mage_Adminhtml_Sales_Order_CreditmemoController->_initCreditmemo()
#6 app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_Sales_Order_CreditmemoController->newAction()
#7 app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('new')
#8 app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#9 app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#10 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#11 index.php(87): Mage::run('', 'store')
#12 {main}

In Mage_Sales_Model_Order_Creditmemo_Item::calcRowTotal on line 265-266:

$availableQty = $orderItemQtyInvoiced - $orderItem->getQtyRefunded();
$rowTotal     = $creditmemo->roundPrice($rowTotal / $availableQty * $this->getQty());

Ok, the second product/item has invoiced qty 0, such so available qty becomes 0.
A divide by 0 raises the warning above.
If I try to fix these lines locally than it will trigger another warning (devide by zero) in other part of the code (Tax.php).
I could try to 'fix' these in core files but I'm still not convinced it will work eventually.

Why all order items are considered in credit memo even if some of the items aren't invoiced ?
Anyone knows a good approach for a fix of this issue ?

I guess overall it's not a big deal since this is a warning and on production servers warnings are logged in var/log at most.

Thank you


texts:
Hello i have updated from 2.2.8 to 2.3.1 now php bin/magento is not working:

php bin/magento list

Fatal error: Uncaught Error: Class 'Zend\Mvc\Controller\LazyControllerAbstractFactory' not found in .../vendor/zendframework/zend-servicemanager/src/ServiceManager.php:314
Stack trace:
#0 .../vendor/zendframework/zend-servicemanager/src/Config.php(137): Zend\ServiceManager\ServiceManager->addAbstractFactory('Zend\\Mvc\\Contro...')
#1 .../vendor/zendframework/zend-modulemanager/src/Listener/ServiceListener.php(225): Zend\ServiceManager\Config->configureServiceManager(Object(Zend\Mvc\Controller\ControllerManager))
#2 [internal function]: Zend\ModuleManager\Listener\ServiceListener->onLoadModulesPost(Object(Zend\ModuleManager\ModuleEvent))
#3 .../vendor/zendframework/zend-eventmanager/src/EventManager.php(490): call_user_func(Array, Object(Zend\ModuleManager\ModuleEvent))
#4 .../vendor/zendframework/zend-eventmanager/src/EventManager.php(248): Zend\EventManager\EventManager->trigger in .../vendor/zendframework/zend-servicemanager/src/ServiceManager.php on line 314


texts:
Check below Image for more understanding question.

If Once already created customer removed/deleted than new customer will start with next not previously deleted.

How can i do so that Customer Id's always in sequence ?

Any guide will be appreciated.


texts: Run a data profile from my Custom module in Magento

texts:
I am trying to run a data profile in custom magento module.
This my Observer in my module where i am trying to run data profile

class CP_Model_Observer {

   public function createupdates($schedules) {
       $collection = Mage::getModel('dataflow/profile')->getCollection();

       foreach ($collection as $profile) {

            $userModel = Mage::getModel('admin/user');
            $userModel->setUserId(0);

            Mage::getSingleton('admin/session')->setUser($userModel);

            if (!$profile->getId()) {
            Mage::log('error: ' . $profileId . ' - incorrect profile id', null, $log_file);
            return;
            }

            Mage::register('current_convert_profile', $profile);

            if($profile->run())
            mail($to,$sub,'Mail To Test');

       }
   }
}

The rest of the functionality in createupdates() function works and send mail too.
I am trying to run a dataprofile for import.
The problem is with this part only. Dont know much about running data-profiles in modules.

Any Help would be highly appreciated.


texts: Why is dispatchEvent taking so long to execute and how can I improve the performance?

texts:
my company is experimenting with using mongoDB to store our categories and products. We've gotten the mongogento extension set up and working, but we noticed that performance is extremely poor when saving categories. I traced the issue to the following line in Mage_Core_Model_Abstract which is taking more than a minute to execute:

  Mage::dispatchEvent($this->_eventPrefix.'_save_commit_after',
  $this->_getEventData());

In our case the line is the dispatching the catalog_category_save_commit_after event. I performed a grep on the whole code base and found only two methods that are triggered by this event: saveCategoryCustomRedirect and processCategorySaveEvent, neither of which take a significant amount of time.

I was wondering if anyone has had similar issues when moving to mongogento or can enlighten me to why the dispatchEvent is taking so long.


texts: Magento : send file attachements in Emails

texts:
in a custom module, I use this function to send Emails:

public function sendMail($errorCod, $errorMsg) {

    $mail = Mage::getModel('core/email');

    $recipients = array(
            Mage::getStoreConfig('trans_email/ident_custom1/name') => Mage::getStoreConfig('trans_email/ident_custom1/email'),
            Mage::getStoreConfig('trans_email/ident_custom2/name') => Mage::getStoreConfig('trans_email/ident_custom2/email')
    );

    foreach ($recipients as $recipient):
        $mail->setToEmail($recipient);

        $mailBody  = "Error Code: ".$errorCod."
";
        $mailBody .= "Error Massage: ".$errorMsg."
";

        $mail->setBody($mailBody);
        $mail->setSubject('Lorem Ipsum');
        $mail->setFromEmail(Mage::getStoreConfig('trans_email/ident_general/email'));
        $mail->setFromName("Lorem Ipsum");
        $mail->setType('html');

        try {
            $mail->send();
        }
        catch (Exception $e) {
    }

    endforeach;

}

I try to send 2 attachements files in the same E-mail.

How can I do that, without using the Mage_Core_Model_Email_Template Model.

Thanks a lot for help.


texts: magento 2 checkout page is keep loading, it wont let us checkout.

texts: when we are trying to checkout the circle is keep moving, it don't let us checkout. We have also cleared the cache files on the chrome.


texts: getChildHtml('info_tabs') ?> printed on product page

texts:
I'm new to Magento. I have just upgraded from 1.8.1.0 to 1.9.3.2. On my product page I get getChildHtml('info_tabs') ?> printed out below our add to cart-button. See screenshot below (I have blurred some product information and the language is Swedish for you who wonder :)).

I get no errors in my Apache error log, nor in var/log/system.log. I have no idea how to proceed since I am new to Magento development.


texts: Estimating shipping rate on product details page in Magento1.9.2

texts:
I am using FedEx shipping carrier, I would like to display shipping rate on product detail page.

I tried following codes in the product view page (catalog/product/view.phtml)

...
if($_product->isSaleable())
{
$quote = Mage::getModel('sales/quote');
$quote->getShippingAddress()->setCountryId('US')->setPostcode('27007');
$quote->addProduct($_product);
$quote->getShippingAddress()->collectTotals();
$quote->getShippingAddress()->setCollectShippingRates(true);
$quote->getShippingAddress()->collectShippingRates();
$rates = $quote->getShippingAddress()->getShippingRatesCollection();

foreach ($rates as $rate)
{
echo $rate->getPrice();
}
}
...

Also, I tried another code

...
if($_product->isSaleable())
    {
$shippingblock = $this->getLayout()->createBlock('checkout/cart_shipping');
        $quote = Mage::getModel('sales/quote');

        $shippingAddress = $quote->getShippingAddress();
        $shippingAddress->setCountryId('US');
        $shippingAddress->setPostcode('27007');
        $shippingAddress->setCollectShippingRates(true);

        $quote->addProduct($_product);
        $quote->getShippingAddress()->collectTotals();
        $quote->getShippingAddress()->setCollectShippingRates(true);
        $quote->getShippingAddress()->collectShippingRates();

        $rates = $quote->getShippingAddress()->getGroupedAllShippingRates();

        if(empty($rates)){
             echo  Mage::helper('shipping')->__('There are no rates available');
        }

        foreach ($rates as $code=>$rate) {
            $carierName = '
'
                . $shippingblock->getCarrierName($code)
                .'
';
            echo $carierName;

            foreach($rate as $r){
                $price = Mage::helper('core')->currency($r->getPrice(), true, false);
                $rates  = '
'
                    . $r->getMethodTitle()
                    . ' '
                    . $price
                    .' ';
                echo $rates;
            }

        }
}
.....

Both the code won't display shipping rate as expected.

Any answer appreciate.


texts: How to upload new product images after Adobe Flash Player EOL?

texts:
I am wondering how can I upload new product images to my Magento 1 store?
Adobe has blocked all Flash content today and I can't see upload button now.
However, I am already working on my new Magento 2 store and it's gonna take few more months meanwhile it's really important for me to upload new images.
I really appreciate any help. Thanks heaps.


texts: How to create two pages from a same module in Magento 2?

texts:
I already have a page when I created a new module. Now, I'm trying to create a new another pages in this module. How can I do that? Which files do I need?
Really hope that anyone can help. Thanks.
I already have this page:

So, when I click on "Order Detail", I want to move to another page (page_detail). The problem I having is how to create the Page detail in this module?


texts: How to update customer information directly in the database

texts:
I have several customers that I need to change a field in.  In my case, the account manager email address.  I'm trying to determine the best way to approach this.  I have enough that I don't want to have to go through the UI to do it as that would be time prohibitive.  It seems like making the changes directly in the database would be easiest but I can't figure out which table contains that information.
What is the best way to go about doing this?  If it is directly in the database, which table contains that data?
I'm using Magento Commerce v2.3.5


texts:
I am trying to give US format phone number validation in onepage checkout page
This is the layout checkout_index_index.xml that i created in my custom module. I know how to make i work by editing the core module (which is a strict no no when it comes to magento), Can anyone tell me what i am doing wrong .

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlockname="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <!-- Your customization will be here -->
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="shipping-address-fieldset" xsi:type="array">
                                                            <item name="children" xsi:type="array">
                                                                <item name="telephone" xsi:type="array">
                                                                    <!--Validation for US phone number format-->
                                                                    <item name="validation" xsi:type="array">
                                                                        <item name="phoneUS" xsi:type="string">true</item>
                                                                    </item>
                                                                    <item name="config" xsi:type="array">
                                                                        <item name="tooltip" xsi:type="array">
                                                                                <item name="description" xsi:type="string" translate="true">For delivery questions.</item>
                                                                        </item>
                                                                    </item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

I tried doing this by copying the entire checkout_index_index.xml page into my custom module ,which worked partially, because when i did that the shipping price disappeared.

i found this magento doc but didnt fully understand it.

Any help would be appretiated


texts: If catalog flat product is enabled topsellers collection no image,name,price!

texts:
Hi i need to enable catalog flat product to boost magento but i have big problem with magento collection. If $visibility is enabled it will crash with 4 Unknown column 'e.visibility' in 'where clause' , if i remove it will load the collection but without image,price,name.  i manage to include name and price in app/core/core.../Collection.php but still i don't know how to load the image.
Maybe this is the wrong way but i hoped it will work, i was wrong.
even 2,3 free extensions that i have used will not work on if collection is from reports.
any help?


texts:
I am trying to make my first ajax request in magento to controller file but can not get it working. My .js file is:

    jQuery.ajax({
        type: 'post',
        url: 'vendor_module/index/htmlcreator',
        data: {key: variable},
        dataType: 'json'
    }).done(function (msg) {
        var variable = "Data Saved: " + msg;
        return variable;
    });

My Controller file:

class htmlCreator extends \Magento\Framework\App\Action\Action{

public function __construct(
Context $context, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory) {
    $this->resultJsonFactory = $resultJsonFactory;
    parent::__construct($context);
}
public function execute() {
    $result = $this->resultJsonFactory->create();
    if ($this->getRequest()->isAjax()) {
        $test = '
Hello World
';
        return $result->setData($test);
    }
}}

What is the controller files url? If it contains domain name how can i find it in js file? What would be the securest way to write url? I prefer not to use phtml file, unless I really need to (security).


texts:
How can I change the Category Product to Static Block  in magento 2 from back end?

I check it in Product -> Categories and select the one category and click Display Setting

then change the Display Mode in Product Only to Static Block only

where I choose the Static Block there is no option for choose block?

Thanks.


texts: Remove selected CMS block in custom widget Magento2

texts:
I have doubts in Magento2 widget.
In my custom widget I have added the CMS block through chooser then saved successfully.
When I come to edit, I need to remove the selected cms block in the widget.

How can I remove the selected cms block?


texts:
If we want to add Owl Slider in Magento 1.X then we follow the below steps.

Copy owl.carousel.min.js and owl.carousel.js and paste into skin/frontend/pakage_name/theme_name/js
Copy owl.carousel.css and paste into skin/frontend/pakage_name/theme_name/css
Goto app/design/frontend/pakage_name/theme_name/layout/page.xml and call js and CSS

And we can use Owl Slider anywhere in Magento 1.X site.
So in Magento 2 how we can call Owl slider and it should be called everywhere in the site so I can use whenever I want.
For this problem, I have referred this link but it's not up to the mark and it's not working.
Right now I have placed Owl slider js in app/design/frontend/pakage_name/theme_name/Magento_Catalog/web/js but it's not working.
Any help would be appreciated.


texts:
I want to change the front end design of my Magento store. I have created new theme from the parent theme LUMA. I also have created html pages and css files as per my desired design. Now i want to integrate my html design to Magento store. I am a newbie to Magento. So guys please help me with design integration.
Any help would be appreciated.
Thanks in advance.


texts: Store locator not working after updating to https

texts: I updated my website to https yesterday, but today I saw that my Storelocator isn't working anymore. It tells me that the 'store list undefined'. How to fix it?


texts:
This is driving me nuts! I'm trying to set a new cookie value:

protected function setCookie($cookieName = null, $cookieVal = null)
{
    $model = Mage::getModel('core/cookie');
    $cookieVal = Mage::app()->getRequest()->getParam('source');
    var_dump('Value: ' . $cookieVal);
    $theCookie = $model->set($cookieName, $cookieVal);
    return $this;
}

The var_dump spits out: string(17) "Value: testpeanut". However, the cookie is never created.

I'm obviously looking for a URL query string like so: domain.com?source=testpeanut. If I replace the $cookieVal = line with the following:

$cookieVal = 'hardcoded_values_work';

Then it works as expected and the cookie is set. What the problem is? Thanks.

~ Edit ~

This code is part of a model observer class. Obviously, I haven't included all of my code here for cleanliness sake. If I get all the params and dump the array, my param is present and has a value:

$cookieVal = Mage::app()->getRequest()->getParams();
var_dump($cookieVal);

Also, if I pass a non-null parameter as a second argument to the getParam() method, it also works:

Mage::app()->getRequest()->getParam($param, 'i_can_see_this');

I need to check if the param is supplied in the URL, which is why that method won't work long-term. I've been tailing all the logs - no errors or warnings at all.


texts: Without select shipping address , click on place order validation not showing Magento 2 checkout page

texts:
I have issue on place order without select shipping address or save shipping address ,click on place order validation not showing in page , showing error like below , how to handle this in Magento 2?
https://prnt.sc/13igbnk
thanks.


texts: Fatal Error on Mage_Catalog_Model_Product_Type_Configurable.php

texts:
Anyone experienced this? I still couldn't spot the issue so might as well call for some help.

PHP message: PHP Fatal error:  Call to a member function getName() on a non-object in /home/site/includes/src/Mage_Catalog_Model_Product_Type_Configurable.php on line 704

Thank you.


texts: I cant associate simple products to configurable Magento 2

texts:
I am trying to associate some simple products with an already created configurable product via code. using a console command that i created. This code creates the configurable product but fails to associate the simple products.

    protected function execute(
    InputInterface $input,
    OutputInterface $output
) {
    $output->writeln('<info>Starting process...<info>');
    $output->writeln('');

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $configurable_product = $objectManager->create('\Magento\Catalog\Model\Product');

    $configurable_product->setSku('A2008'); // set sku
    $configurable_product->setName('SOLUCION S. NORMAL 0.9%'); // set name
    $configurable_product->setAttributeSetId(4);
    $configurable_product->setStatus(1);
    $configurable_product->setTypeId('configurable');
    $configurable_product->setPrice(0);
    $configurable_product->setWebsiteIds(array(1)); // set website
    $configurable_product->setCategoryIds(167); // set category
    $configurable_product->setHasOptions(1);

    // super attribute
    $presentation = 136;

    $configurable_product->getTypeInstance()->setUsedProductAttributeIds(array($presentation), $configurable_product); //attribute ID of attribute 'size_general' in my store

    $configurable_product->setCanSaveConfigurableAttributes(true);

    $configurableProductsData = array();
    $configurableProductsData['3974'] = array( //['920'] = id of a simple product associated with this configurable
        '0' => array(
            'label' => 'presentation', //attribute label
            'attribute_id' =>   136, //attribute ID of attribute 'color' in my store
            'value_index' => 2139 //value of 'Green' index of the attribute 'color'

        )
    );
    $configurable_product->setConfigurableProductsData($configurableProductsData);

    try {
        $configurable_product->save();
    } catch (Exception $ex) {
        echo '<pre>';
        print_r($ex->getMessage());
        exit;
    }

    $productId = $configurable_product->getId();

    // assign simple product ids
   // $associatedProductIds = array(3974,   );

  /*  try{
    $configurable_product = $objectManager->create('Magento\Catalog\Model\Product')->load($productId); // Load Configurable Product
       // $configurable_product->setAssociatedProductIds($associatedProductIds); // Setting Associated Products
        $configurable_product->setCanSaveConfigurableAttributes(true);
        $configurable_product->save();
    } catch (Exception $e) {
        echo "<pre>";
        print_r($e->getMessage());
        exit;
    }*/
    $output->writeln('<info>Done<info>');

}


texts:
I'm following this tutorial to create a new table inside the database.

From the tutorial, I've followed till Step 4. I can verify that a the new module is created after running php bin/magento setup:upgrade, but no table named greeting_message is created for me.

I guess, The database here refers to the database I created while Installing Magento. I've seen all the tables of the database from phpmyadmin but there is no database named greeting_message.

Where am I going Wrong?

InstallData.php

<?php

    namespace Learning\GreetingMessage\Setup;

    use Magento\Framework\Setup\InstallDataInterface;
    use Magento\Framework\Setup\ModuleContextInterface;
    use Magento\Framework\Setup\ModuleDataSetupInterface;

    /**
     * @codeCoverageIgnore
     */
    class InstallData implements InstallDataInterface
    {

      /**
       * {@inheritdoc}
       * @SuppressWarnings(PHPMD.CyclomaticComplexity)
       * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
       * @SuppressWarnings(PHPMD.NPathComplexity)
       */
      public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
      {
        /**
         * Install messages
         */
        $data = [
             ['message' => 'Happy New Year'],
             ['message' => 'Marry Christams']
             ];
        foreach ($data as $bind) {
          $setup->getConnection()
        ->insertForce($setup->getTable('greeting_message'), $bind);
        }
      }
    }

InstallSchema.php

<?php
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

namespace Learning\GreetingMessage\Setup;
use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallSchema implements InstallSchemaInterface
{
  /**
   * {@inheritdoc}
   * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
   */
  public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
  {
    /**
     * Create table 'greeting_message'
     */
    $table = $setup->getConnection()
      ->newTable($setup->getTable('greeting_message'))
      ->addColumn(
                  'greeting_id',
                  \Magento\Framework\DB\Ddl\Table::TYPE_INTEGER,
                  null,
                  ['identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true],
                  'Greeting ID'
          )
      ->addColumn(
                  'message',
                  \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                  255,
                  ['nullable' => false, 'default' => ''],
          'Message'
          )->setComment("Greeting Message table");
    $setup->getConnection()->createTable($table);
  }
}


texts:
I'm playing with M2 API. I built a test module that returns specific Order items in JSON format. I set @return as 'string' (see screenshot below).

Problem: I'm getting error: Class string does not exist.

Question: how should I set @return in phpbloc to get it work properly?


texts: Magento 2 - How I can setup product price per quantity

texts:
I have some simple and configurable products in Magento 2, before in the Magento 1 version we have tier prices to sell this products with different price per quantity. How I can do this on Magento 2 version?

Buy 48 for £1.45 each and save 42%
Buy 80 for £1.25 each and save 50%
Buy 120 for £1.20 each and save 52%

Thank you


texts: How to Locally Setup Magento Enterprise Cloud Edition

texts:
I am working on a new project where the client has taken subscription of Magento Enterprise Cloud Edition.

I know that Magento Enterprise Cloud Edition enables us to use the following three types of environments, i.e. integration, staging, and production.

I have its account access like

I took its clone on locally and try to do installation through "composer install" like we do in CE. but its ended on error

  File doesn't exist: bin/magento Check "chmod" section in composer.json
  of magento/magento2-base package. File doesn't exist: bin/magento
  Check "chmod" section in composer.json of magento/magento2-ee-base
  package.

I donot know whats the right way of doing its local setup. Enterprice is a new environment for me. Kindly guide me it would be a great favour.


texts: Magento 1.9, php 5.6 - Use of iconv.internal_encoding is deprecated

texts:
Have the same with Magento CE 1.8 and 1.9

After update php from 5.5.16 to 5.6.0 on my VPS I got this 2 errors in [magento]/var/log/system.log:

ERR (3): Deprecated functionality: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated  in [magento]/lib/Zend/Locale/Format.php on line 311
ERR (3): Deprecated functionality: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated  in [magento]/lib/Zend/Locale/Format.php on line 472

I was find this info https://github.com/zendframework/zf1/pull/347
But all variations in php.ini changes not work for me (I was restarted php-fpm service after each changes in php.ini, of course).

Here https://github.com/zendframework/zf1/pull/347/files#r14075423 I read suggested changes exactly in this lines (313 and 474) but I don't want use any hacks to Magento Core files.

In frontend and backend I don't see any problems with encoding - all looks fine (I have Russian localizations - frontend and admin panel).

May I ignore this ERR in system.log or not? What the right way to correct this error?


texts:
After installing the extension from magenerds, I wasn't able to run the compiler, I was getting an error mentioned below.

I've tried removing the extension but no luck.

Tried the following Steps

Removing from /app/code
Disabling by entering 0 in config.php
Empty out /var/generated/* folder

Still, I am getting

Class Magenerds\PageDesigner\Model\ValidationState does not exist


texts: Hi I'm using magento 2 and recently I notice there are strange account accounts created.  We have in place an approval system that when a customer signs up we need to approve their account.  However, I'm not sure how its being done but there has been a few accounts that were created.  Does anyone know how this is done and how I can prevent this from happening?  thanks.


texts: I am using Magento but not able to download it on windows 7

texts:
I am not able to download it on windows 7 on Wamp server but it easily downloaded on Linux.

What can I do to download it on windows 7?


texts:
I want to add some Cash on delivery charges in my magento 1.9.3.2 website. Which can be automatically added in bill in onepage checkout page and also in invoice.
I do not want to add any extension.

Kindly help me out form this.

Than in advance.


texts:
I am new in magento can any one tell me why use this code????
and location of these file

$content = $this->getChildHtml('', true, true);

full code for show products in category page..

<?php
    $id = $this->getData('wrapperId');
   echo $class = $this->getData('wrapperClass');
     $content = $this->getChildHtml('', true, true);
?>
<?php if (!empty($content)): ?>
    <?php if ($id || $class): ?>
        <div <?php if($id):?>id="<?php echo $id ?>"<?php endif;?> <?php if($class):?>class="<?php echo $class ?>"<?php endif;?>>
            <?php echo $content ?>
        </div>
    <?php else: ?>
        <?php echo $content ?>
    <?php endif ?>
<?php endif ?>


texts: Best practice Magento dev environment, how do teams develop Magento?

texts: I'm trying to set up a dev environment for my team to work together on 1 Magento project. But I don't know if I should use a shared server with a Magento installation or if we should all install Magento locally and share a database/git repo?


texts: Magento2.3.4 Add green border when validation of input is succesfull on Checkout Page

texts: When input is invalid we can see red border and error message below. Is it possible to add green border when input is valid ?


texts: Is there a Way to test Checkout Templates?

texts:
I've got the problem that we use paypal express on our Page and the Review Page (Url like http://mysite.dev/paypal/express/review) looks wrong and is not usable by the customer.

Now i want to optimize this site so that it looks good.
But i got the problem that i can't step through the checkout process every time i do some  changes.

Isn't there a proper way to test templates in the Checkout?


texts: Workflow - handling databases during development

texts:
I work for a small agency and we often have more than one developer working on a magento project. We work locally, and then commit to github after each phase of development. The problem we are having is managing the database content.

Currently, each developer takes a sql dump of their local database and pushes that to github as part of the commit. We have a system that takes the github repo and pushes that to a staging server. Part of the system grabs the sql dump file and updates the staging server db.

The problem we have is that if dev 1 has - for example - created a bunch of cms pages, and dev 2 has installed and configured some modules, merging the 2 sql files is very difficult, and we end up spending way too much time merging the two dbs.

Can anyone suggest a better workflow process to handle this?


texts: Magento 1.9: How to get Manufacturer's Suggested Retail Price of product?

texts:
i tried this code but it empty.

$collection = Mage::getModel('catalog/product')->getCollection();
            foreach($collection as $product){
                print_r($product->getmsrp());
            }exit;


texts: Need to create a separate mobile homepage. Does anyone know how?

texts: I have Magento 2 store and I like the desktop theme but I do not like the mobile look of my homepage. How can I edit the mobile look of my homepage without altering the desktop version? At the moment if I alter the code both are changed. Is there any extension or method I can use to maybe create a separate mobile homepage and lead my customers there when they are on mobile devices?


texts: How to set Page wise Restriction in magento 2?

texts:
I am making one extension which displays header notification at top of page,
I am make one multi select field in system.xml in which user select pages in which he/she want to display Notification. For example if user select HomePage and About us page then notification display in only this two page. How to achieve this?


texts:
I'm new to Magento and I'm trying to add an additional button to a pre-existing admin form using an observer. I set up my config to what I believe is the right event handle. I created an observer and added the name and method to config. I don't believe my observer is ever hit since Mage log is not printing. Can anyone see where I'm going wrong?

Sales.xml -  (Enterprise layout file)

<layout>
   <adminhtml_sales_order_view>
        <reference name="content">
            <block type="adminhtml/sales_order_view" name="sales_order_edit"></block>
        </reference>
   </adminhtml_sales_order_view>
</layout>

config.xml

<?xml version="1.0" encoding="UTF-8"?>

<config>
    <modules>
        <Mycompany_MyModule>
            <version>0.1.0</version>
        </Mycompany_MyModule>
    </modules>
    <global>
        <events>
            <adminhtml_sales_order_view>
                <observers>
                    <my_observer>
                        <type>singleton</type>
                        <class>Mycompany_MyModule_Model_Observer</class>
                        <method>addMyButton</method>
                    </my_observer>
                </observers>
            </adminhtml_sales_order_view>
        </events>
    </global>
</config>

Observer.php

<?php

class Mycompany_MyModule_Model_Observer
{
    public function addMyButton($observer)
    {
        Mage::log('test observer');

        $container = $observer->getBlock();
        if(null !== $container && $container->getType() == 'adminhtml/sales_order_view')
        {
            $data = array(
                'label'     => 'My button',
                'class'     => 'go',
                'onclick'   => 'setLocation(\' '  . Mage::getUrl('*/*', array('param' => 'value')) . '\')',
            );
            $container->addButton('my_button_identifier', $data);
        }
        return $this;
    }
}


texts: Is there a callback I can use after a form has been validated?

texts:
I have to reflow the Foundation equalizer on a page that contains a form [contact page] - if validation failsthe form will overlap the footer with the added validation error elements.

<script type="text/javascript">
//<![CDATA[

    var contactForm = new VarienForm('contactForm', true);

    jQuery('#contact-submit').click(function(){
        console.log('submitted');
        jQuery(document).foundation('equalizer', 'reflow');
    });

//]]>
</script>

Obviously this only works after the submit button is clicked a second time.

Is there a callback function [or something] I can use after Magento have validated the form to call the Foundation reflow?

UPDATE

According to some different docs here and there, I'm supposed to be able to do something like this:

<script type="text/javascript">
//<![CDATA[
    var contactForm = new VarienForm('contactForm', {onFormValidate: myCallback, immediate : true});

    function myCallback(result, form) {
        console.log('callback = ' + result);
    }
//]]>
</script>

It will validate the form, but does not fire the callback OR validate immediately....


texts: M1. Using Tablerate/Matrixrate for shipping, but having a problem with Germany/Deutschland

texts:
M1.9.4.x.
We are using Tablerate/Matrixrate for shipping, but having a problem with Germany/Deutschland. We are seeing the error `Sorry, no quotes are available for this order at this time.``
Our csv looks like below
Question: why is germany not being selected / found this used to work fine? And maybe in addition we can see the warning is triggered in file onepage/available.phtml ... would it be a good idea to add some console logging, or logging of any kind ... to identify 'what' the lookup was without results?
ps. somehow I think 'DEU' is working correctly, just not the product? Because otherwise would it not fall back on *,*,*
Help appreciated

Country,Region/State,"Zip/Postal Code","Minimum Order Weight","Minimum Order Amount","Minimum Quantity","Parcel Type","Shipping Price"
,*,*,0.0000,0.0000,0,regular,19.9500
,*,*,0.0000,100.0000,0,regular,15.6500
,*,*,0.0000,200.0000,0,regular,9.9500
,*,*,0.0000,300.0000,0,regular,0.0000
BEL,DEU,*,*,0.0000,0.0000,0,regular,8.6500
BEL,DEU,*,*,0.0000,50.0000,0,regular,5.6500
BEL,DEU,*,*,0.0000,100.0000,0,regular,0.0000
FIN,HUN,IRL,POL,PRT,ESP,SWE,CAN,CHE,*,*,0.0000,0.0000,0,regular,16.9500
FIN,HUN,IRL,POL,PRT,ESP,SWE,CAN,CHE,*,*,0.0000,100.0000,0,regular,8.9500
FIN,HUN,IRL,POL,PRT,ESP,SWE,CAN,CHE,*,*,0.0000,200.0000,0,regular,0.0000
FRA,MCO,ITA,LUX,AUT,DNK,GBR,*,*,0.0000,0.0000,0,regular,16.9500
FRA,MCO,ITA,LUX,AUT,DNK,GBR,*,*,0.0000,100.0000,0,regular,8.9500
FRA,MCO,ITA,LUX,AUT,DNK,GBR,*,*,0.0000,200.0000,0,regular,0.0000
NLD,*,*,0.0000,0.0000,0,letter_box,5.9500
NLD,*,*,0.0000,0.0000,0,regular,8.9500
NLD,*,*,0.0000,20.0000,0,letter_box,4.9500
NLD,*,*,0.0000,20.0000,0,regular,6.7500
NLD,*,*,0.0000,50.0000,0,regular,3.7500
NLD,*,*,0.0000,50.0000,0,letter_box,2.9500
NLD,*,*,0.0000,100.0000,0,regular,0.0000
NLD,*,*,0.0000,100.0000,0,letter_box,0.0000


texts: exclude previously displayed products on product page

texts:
exclude previously displayed products while sorting random and navigating to next page

i m using

if($this->getCurrentOrder() != 'price'){
        if($this->getCurrentOrder() != 'created_at') {
            $this->_collection->getSelect()->order('rand()');
        }else{
            $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
    }
}else{
        $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}

in toolbar.php to display random items in product page but the products keep repeating !!


texts:
I create a new custom module for Magento 2 and I can't install it through composer. This is the error:

Your requirements could not be resolved to an installable set of packages.

      Problem 1
        - The requested package mycustom/module could not be found in any version, there may be a typo in the package name.
      Problem 2
        - magento/framework 101.0.0 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (5.6.32) or value of "config.platform.php" in composer.json does not satisfy that requirement.
        - magento/framework 101.0.0 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (5.6.32) or value of "config.platform.php" in composer.json does not satisfy that requirement.
        - magento/framework 101.0.0 requires php 7.0.2|7.0.4|~7.0.6|~7.1.0 -> your PHP version (5.6.32) or value of "config.platform.php" in composer.json does not satisfy that requirement.
        - Installation request for magento/framework == 101.0.0.0 -> satisfiable by magento/framework[101.0.0].

    Potential causes:
     - A typo in the package name
     - The package is not available in a stable-enough version according to your minimum-stability setting
       see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

    Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

    Installation failed, reverting ./composer.json to its original content.

This is my composer.json file:

{
    "name": "mycustom/module",
    "description": "New module for test",
    "require": {
        "php": "~5.5.22|~5.5.23|~5.5.24|~5.5.25|~5.5.26|~5.5.27|~5.5.28|~5.5.29|~5.5.30|~5.5.31|~5.5.32|~5.5.33|~5.5.34|~5.5.35|~5.5.36|~5.5.37|~5.5.38|~5.6.0|~5.6.1|~5.6.2|~5.6.3|~5.6.4|~5.6.5|~7.0.2|~7.1.0|~7.1.1|~7.1.2|~7.1.3|~7.1.4|~7.1.5|~7.1.6|~7.1.7|~7.1.8",
        "mycustom/module-parent": "*"
    },
  "authors": [
    {
      "name": "Name Lastname",
      "email": "email@example.com",
      "homepage": "http://www.example.com/",
      "role": "Developer"
    }
  ],
    "type": "magento2-module",
    "version": "1.0.0",
    "minimum-stability": "alpha",
    "prefer-stable": true,
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Mycustom\\Module\\": ""
        }
    }
}

How I can solve this issues?

Thank you


texts: How to get item's weight and row_weight on sales_quote_item_save_after

texts:
I would like to extract some information from a Mage_Sales_Model_Quote_Item object while adding a product to the cart with the sales_quote_item_save_after event.

When I add a configurable product to the cart (e.g.: a white XL shirt), the event is triggered four times :

On Mage_Checkout_CartController->addAction() : it contains a Quote Item of the configurable product (e.g.: shirt) with prices and others data. It also contains the Quote Item associated to the simple product (white XL shirt) in a _children property
On Mage_Checkout_CartController->addAction() : it contains the Quote Item of the simple product that was in the _children property above. This one doesn't contain prices information as these are only on configurable products
On Mage_Checkout_CartController->indexAction() : it contains the Quote Item of the 1st step, with more information, like the weight and the row_weight
On Mage_Checkout_CartController->indexAction() : it contains the Quote Item of the 2nd step, also with more information

So, my issue is that i would like to work only on the 1st or the 2nd step (as the indexAction should not be affected by the module i'm working on), but on these 2 steps, i can't get the weight and the row_weight data.

So i've reviewed the Magento Core to get how these information are loaded on the indexAction() and it appears that when the Mages_Sales_Model_Resource_Quote_Item_Collection is loaded, the _afterLoad() method executes _assignProducts() that load the weights and forwards them by a setProduct() method from the Mage_Sales_Model_Quote_Item class.

Then, i tried to do this on my observer :

$item = $observer->getEvent()->getItem();
$item->getQuote()->getItemsCollection()->clear()->load()

After that, it appears that i can get the weight inside the :

`$item->getQuote()->getItemsCollection()->getFirstItem()`

Does anyone have a better solution or idea ? Because i'm not really satisfied with that one.

Thanks all.


texts: Magento 2 : How to change default path of a Field of type "image"?

texts:
How to change image path of a Field of type "image" ?

In my custom module adminhtml form I am using field as type "image" to show thum image. I want to change the default path of this thum and want to use my custom path here, as my image upload path is different.

Here is my addField example :

$fieldset->addField(
        'image',
        'image',
        array(
            'name' => 'image',
            'label' => __('Example Image'),
            'title' => __('Example Image'),
            'required' => false,
        )
    );


texts:
I changed magento2 country name but didn't worked.

I changed in the below file:

  File: vendor/magento/zendframework1/library/Zend/Locale/Data/xx.xml

How to change the country name ?


texts: How to apply a category's display setting to all categories?

texts:
I have many categories and instead of applying new settings to all categories one by one, i would like to know if this is possible to apply new settings to all categories at once?

Thanks!


texts: Remove toolbar from specific category products added as a block in cms page?

texts:
I added below line in CMS Home Page to display products of a certain category in Magento 1.

{{block type="catalog/product_list" column_count="4" category_id="179" template="catalog/product/list.phtml"}}

Now I can see the products of that category. But I also got a tool-bar as a phtml file (I got this using Template Path Hints). Now I would like to know how can I find which XML file include this phtml file ? I would like to remove that inclusion of phtml file from XML file.


texts:
I am a newbie in magento, it seems to be an easy question but i spend hours still cannot figure it out..

I installed the sample data for Magento1.9 (attached), the bottom blocks (title in blue color) "Company" and "Connect with us" are two static blocks. But i cannot figure out how they are placed there, neither the CMS-page or other CMS-block have mention them. And i checked all XML files, none of these static blocks are mentioned! Why?
How can I modify, for example, put the "company" block after the "Connect with us" block?

Thanks a lot for anyone can help!


texts: Magento 2.3: How To Get The Primary Key From URL...?

texts:
I'm very new to Magneto 2.3, I'm trying to get the primary key from URL, this is my code:

This is my import button, on click of this button, a function hit.

/app/code/EC/Customimport/view/adminhtml/templates/form/import.phtml

    <button class="import" id="<?php echo $block->getId() ?>" onclick="return false;">
        <?php echo 'Import'; ?>
    </button>

This is the file and in that file their is a function execute, where I'm trying to get the primary key, please see the code below:

/app/code/EC/Customimport/Controller/Adminhtml/Index/Import.php

<?php

namespace EC\Customimport\Controller\Adminhtml\Index;

use EC\Customimport\Model\CustomimportFactory;
use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;

class Import extends \Magento\Backend\App\Action
{
    protected $request;

    /**
     * @param Context $context
     */
    public function __construct(
        \Magento\Framework\App\Request\Http $request,
        Context $context,
        CustomimportFactory $modelCustomimportFactory
    ) {
        $this->request = $request;
        $this->modelCustomimportFactory = $modelCustomimportFactory;
        $this->resultFactory = $context->getResultFactory();
        parent::__construct($context);
    }

    public function execute(){
        ignore_user_abort(true);
        set_time_limit(0);

        //$id = $this->request->getParams('customimport_id');
        //print_r($id);
        //exit;

        $postData = $this->getRequest()->getPost();
        $id = $postData['customimport_id'];
        print_r($id);
        exit;
    }
}


texts: Magento2 multi-store price-per-website: Wrong price indexed for configurable products

texts:
I have a multi-website Magento 2.1.0 CE installation, with 2 websites and different prices per-website. Prices are note related to each other, for the same product across the two websites.

In product listing pages (PLP), I keep seeing "as low as $55.55" for configurable prices, along with the correct prices, in non-default website 2, even though prices have been set correctly, all configurable children have the same prices $55.55 in website 1 (default) and $77.77 in website 2 (non-default). Configurable product itself has been priced accordingly, there are no special nor tier prices applied.

I've checked price attribute values in database, all prices are save correctly per-website. Checking the price index table, though, returns correct min_price and max_price for simple products but prices from the wrong website for the configurable products, which is causing the "as low as" issue in product listing pages.

No 3rd-party modules are affecting indexing (vanilla Magento).

Anyone had the same issue?


texts: Google Adwords ROI tracking with GoogleAnalyticsPlus by Fooman

texts:
We have a multi store sitaution where the roi is tracking sending the conversion value to google.

We pay for our google adwords in £ but for our multi store we take Euro and SEK (swedish)

Is there a way through the module or google adwords we can do the currency conversion as the GBP spend against the SEK conversion is skewing the results considerably.


texts: Bulk updating product prices : Magento 2

texts:
In my M2 store I have over 200k products. They were added manually
  through API (https://domain.com/rest/all/V1/products call).

Nowadays prices of my products are changing frequently and I need to update all of them when I receive price list from my supplier.

What would be the best and quickest way to update prices of all my products? API calls would take too much time.

CSV import using M2 backend was giving me some errors in the past due to large amount of products.

Any idea? One think which comes to my mind is to write a php script to parse my price list CSV file and make directly SQL queries to a database.


texts: Magento 2.1.9 upgrade to 2.2.0 - Error on setup:upgrade with Magento_Sales table get error when upgrade

texts:
Upgrading magento from 2.1.9 to 2.2.0 and during the automatic bin/magento setup:upgrade process, it runs all upgrades fine until it reaches the magento_sales table where it produces this error.

Upgrading data.. Error converting field product_options in table sales_order_item where item_id= 2, 3, 5, 7, 10, 13, 17, 21, 26, 43, 46, 48, 69, 70, 71, 76, 81, 82, 91, 98, 101, 105, 108, 111, 116, 117, 122, 123, 127, 131, 135, 139, 141, 144, 145, 154, 164, 166, 171, 172, 173, 7659, 7660, 7671, 7672, 7681 using Magento\Sales\Setup\SerializedDataConverter. Fix data or replace with a valid value.

How can I solve this error. Please help.


texts: How to use custom source model in eav_attribute

texts:
Ho can I use a custom source in the source_model of the eav_attribute table?
Thats my source

*
* @category  Mcas
* @package   Mcas_Industries
* @copyright Copyright (c) 2019
* @license   http://opensource.org/licenses/mit-license.php MIT License
*/
namespace Mcas\Industries\Source;

class Industry implements \Magento\Framework\Option\ArrayInterface
{
/**
 * Industry repository
 *
 * @var \Mcas\Industries\Api\IndustryRepositoryInterface
 */
protected $industryRepository;

/**
 * Search Criteria Builder
 *
 * @var \Magento\Framework\Api\SearchCriteriaBuilder
 */
protected $searchCriteriaBuilder;

/**
 * Filter Builder
 *
 * @var \Magento\Framework\Api\FilterBuilder
 */
protected $filterBuilder;

/**
 * Options
 *
 * @var array
 */
protected $options;

/**
 * constructor
 *
 * @param \Mcas\Industries\Api\IndustryRepositoryInterface $industryRepository
 * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
 * @param \Magento\Framework\Api\FilterBuilder $filterBuilder
 */
public function __construct(
    \Mcas\Industries\Api\IndustryRepositoryInterface $industryRepository,
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Magento\Framework\Api\FilterBuilder $filterBuilder
) {
    $this->industryRepository    = $industryRepository;
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->filterBuilder         = $filterBuilder;
}

/**
 * Retrieve all Industries as an option array
 *
 * @return array
 * @throws StateException
 */
public function getAllOptions()
{
    if (empty($this->options)) {
        $options = [];
        $searchCriteria = $this->searchCriteriaBuilder->create();
        $searchResults = $this->industryRepository->getList($searchCriteria);
        foreach ($searchResults->getItems() as $industry) {
            $options[] = [
                'value' => $industry->getIndustryId(),
                'label' => $industry->getIndustry(),
            ];
        }
        $this->options = $options;
    }

    return $this->options;
}

/**
 * @return array
 */
public function toOptionArray()
{
    return $this->getAllOptions();
}
}


texts: Magento Coupon Codes Not Working When Customer Logged In Since Failed Upgrade

texts:
Ever since a failed upgrade from 1.8.1 to 1.9.1 (rolled back now) coupon codes don't work for customers that are logged in. Works fine when not logged in.
I just purchased an extension that lets me set customer error codes for coupons and when logged in the error is for the 'catch all' error - ie one that has no known reason.

I am thinking that maybe the file that controls coupon application is corrupt or somehow not successfully rolled back

Does anyone know what file applies coupons in the cart and checkout so I can re-install from a fresh down of our version?

THanks


texts: Search results for specific words like "to" , "toy" giving results in suggestion like query.


texts: category listing page and product listing page with condtion in single page

texts:
i have a dslr main category which contains 4 different subcategories. dslr is included in navigation menu with url dslr.html.

in dslr.html page i have shown subcategories list. (DSLR Category : Display mode => static block only & CMS Block => subcateogry listing and this subcategory listing block includes phtml file subcategory-listing.phtml file to display subcategories under current category.)

Now, in navigation menu i have listed brands under dslr (as dropdown) sony,panasonic etc. When i click on sony under dslr i want to show all dslr of sony brand. and i have url of this like this mystie.com/dslr.html?manufacturer=11. And this url doesn't show me products under dslr assigned to sony as the dslr category has display mode=>static block.

It shows as correctly if i made dslr category Display mode=>products but when someone clicks on dslr link i need to show subcategories listings.

So how can i manage two different displays under same link and with manufacturer id being passed on url ?


texts: How to display Yes/No Attribute on Catalog Page

texts:
Typically I can use the following code to display something like an image or a button on a product page when the value of the IF statement is "1" or "true:"

<?php if ($_product->getData('SOME-ATTRIBUTE')): ?>
<button type="button" title="<?php echo $this->__('This Item Has Been Discontinued') ?>" class="button btn-cart discontinued"><?php echo $this->__('Discontinued') ?></button>
<?php endif; ?>

However, this does not work on catalog listing pages. The IF statement is ignored. How should this be written to work on catalog listing pages?


texts: Buy X Get Y ,working But applying to whole cart

texts:
Below is my condition for cart rule

  If ALL  of these conditions are TRUE : If an item is FOUND  in the
  cart with ALL  of these conditions true:  Price  greater than  10
  Price  less than  150   SKU  is  test Dinner Plate

And action as follows:

  Apply - Buy X get Y free (discount amount is Y)  Discount Amount : 1
  Maximum Qty Discount is Applied To : 0  Discount Qty Step (Buy X) : 2

Now it works when I add 3 items of 'test Dinner Plate' to cart,! item price is added as discount.Price of  test Dinner Plate is 145 .

Now when I add 3 items of different sku 'Dinner Plate' , the rule is not getting applied but the moment I add one 'test Dinner Plate' to cart, the rule is getting applied to other product which is added to cart .

The rule is actually getting applied to the whole cart which has 3 items in cart.

Ideally this should be applied only to the sku which we have added to the rule but is not.
Is there any configuration missing while creating the rule .Please help


texts: Geting bundle product price by product id this code working without cron but in cron doesn't work Magento2

texts:
This code work without cron, but in cron doesn't work it's returning Zero[0]
Also check cron is executing successfully.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$product = $objectManager->create('Magento\Catalog\Model\Product')->load($product_id);
if ($product->getTypeId() == 'bundle') {
  $regularPrice = $product->getPriceInfo()->getPrice('regular_price')->getMinimalPrice()-
>getValue();
  $specialPrice = $product->getPriceInfo()->getPrice('final_price')->getMinimalPrice()-
>getValue();
}

Here product_id is your product Id.


texts: Admin Custom Page : Cannot Set Page Title in Magento 2

texts:
This is my etc/adminhtml/menu.xml

<add id="My_Module::first" title="I Am Parent" module="My_Module" sortOrder="1" parent="My_Module::parent" resource="My_Module::first" />

<add id="My_Module::firstchild" title="first child" module="My_Module" sortOrder="1"  action="" parent="My_Module::first" resource="My_Module::firstchild"/>
<add id="My_Module::secondchild" title="second child" module="My_Module" sortOrder="2"  action="" parent="My_Module::first" resource="My_Module::secondchild"/>
<add id="My_Module::thirdchild" title="third child" module="My_Module" sortOrder="3"  action="module/route/index" parent="My_Module::first" resource="My_Module::thirdchild"/>

Now I want to change title for the thirdchild menu item,
so i did this from index controller of thirdchild

index.php

public function execute(){
    $this->resultPage = $this->resultPageFactory->create();
    $this->resultPage->setActiveMenu('My_Module::first');
    $this->resultPage->getConfig()->getTitle()->set((__('I Am Third Child')));
    return $this->resultPage;
}

But it always comes with its parent title I Am Parent.

I also try to change title from module_route_index.xml like below,

<head>
 <title>I Am Third Child</title>
</head>

But it also dont works, is there any solution i can try further.

Thanks


texts: error on line 11 at column 16: xmlParseEntityRef: no name in Magento 2

texts:
I am getting following issues when XML file open in the browser:-

This page contains the following errors:
error on line 11 at column 16: xmlParseEntityRef: no name
Below is a rendering of the page up to the first error.


texts:
My product pages have recently started to take up to 50-100+ seconds to load. I have made no changes to my Magento code and, after speaking extensively with my host, no changes have been made server side (I think).

An example of an affected page:

http://www.blindssupreme.ca/index.php/shop/blinds/faux-wood-blinds/value-faux-wood.html

Pages that work:

http://www.blindssupreme.ca/index.php/shop/blinds/faux-wood-blinds.html

After investigating, I noticed that, upon visiting the affected page, CPU usage jumps to 100% (and basically bogs down the site for anyone else to view). In my system.log, I get the following message:

DEBUG (7): getPriceType::client

The affected Magento version is 1.5.1. We also don't really get that many visitors (no more than ~10 at any one time) so I don't think it's that.


texts: How do i check if site is infected by SUPEE-5344 and SUPEE-1533

texts:
i applied already the two patches SUPEE-5344 and SUPEE-1533, but how do i check, or how do i know my site and files are not already infected?

Thanks in advance.


texts: Magento 1.9: Display out of stock products for a Store view

texts:
I have this situation where I need to display out of stock products in one of my stores.

I use multistore Magento installation, so 4 stores are running under one installation.

For 3 stores I have set in Magneto not to display products which are out of stock - which is Ok (I need that)!

Question/Issue:
For one store I have to make all products are shown in the frontend, but it seems like the stock option -> Display Out of Stock Products (yes or no) is configured with default config within the installation of Magento.

Does somebody know how to Display out of stock products in one of my stores?

Thanks


texts: Problem on front end shipping table rate calculation amount not showing correctly in review order page - magento2.3

texts:
I am using magento2.3

table rate -> enabled:yes

condition:Weight vs Destination

Ship to Applicable Countries:specific countries

Include Virtual Products in Price Calculation:yes

Calculate Handling Fee:Fixed, Ship to Specific Countries: India

the Table rate Select Shipping Method page showing the table rate amount correct but it not showing correctly in Review order page

In this image1(click on image) table rate amount showing correctly(Address 1 of 3)

In this image2(click on image) the table rate amount not showing correctly(Address 1 of 3), But total value of Address 1 of 3 is correct but showing value is not correct

Address 2 of 3 image3 image

Address 3 0f 3 image4 image

Single Address delivery it's working fine,This issue will happen in multi address delivery time only.***

How to fix this issue,Please help me....