The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

@Rv Singh, You increase the setTimeout() value from 100 to 200 or 300


0

$indexerFactory = $this->_objectManager->get('Magento\Indexer\Model\IndexerFactory'); $indexerIds = array( 'catalog_category_product', 'catalog_product_category', 'catalog_product_price', 'catalog_product_attribute', 'cataloginventory_stock', 'catalogrule_product', 'catalogsearch_fulltext', ); foreach ($indexerIds as $...


4

The most likely issue is that you are using an extension which is changing how configurable products work or your theme is doing it. Most extensions regarding configurable products change the functionality to use prices directly from the child products (the products assigned to the configurable product). I can recommend several things you could try that ...


1

Create a custom Rest API in magento 2 and use below code with magento <?php namespace Vendor\module\Controller\Index; class Index extends \Magento\Framework\App\Action\Action { protected $_pageFactory; public function __construct( \Magento\Framework\App\Action\Context $context, \Magento\Indexer\Model\IndexerFactory $indexerFactory, ...


0

The above one is a known issue for Magento and can be solved partially by installing the below extension. https://github.com/interjar/configurable-child-visibility Reference for the Issue can be found at Magento Issue 10454


1

Try this way... <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); ini_set('memory_limit', '5G'); error_reporting(E_ALL); use Magento\Framework\App\Bootstrap; /** * If the external file is in the root folder */ require __DIR__ . '/app/bootstrap.php'; $params = $_SERVER; $bootstrap = Bootstrap::create(BP, $params); $obj = $...


0

This is a core issue in Magento 2. Here is the issue url: https://github.com/magento/magento2/issues/21663 You can try these two answers in the above issue: https://github.com/magento/magento2/issues/21663#issuecomment-477966963 https://github.com/magento/magento2/issues/21663#issuecomment-501121021


0

You have to put the return (float) $price in the aroundResolvePrice function to solve the price = 0 issue


0

The price calculation is done for the configurable products as below and you should be able to use the OOB solution. You created many simple products and set the price respectively for each simple products. SKU, Size, Fabrics, Color, Price SKU1, 10, Silk, Red, 100 SKU1-2, 10, Silk, Blue, 150 SKU2, 11, Silk, Blue, 200 SKU3, 12, Silk, Black, 300 SKU4, 13, ...


0

Try below solution for configurable swatches Step1: app/design/frontend/Vendor/Theme/Magento_Swatches/templates/product/view/renderer.phtml Use code as in original question <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//...


0

Please try with below code in this path : app/design/frontend/Vendor/Theme/Magento_Swatches/templates/product/listing/renderer.phtml <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $jsonEncoder = $objectManager->create('\Magento\Framework\Json\EncoderInterface'); $localeFormat = $objectManager->create('\Magento\...


2

app/design/frontend/Custom/mytheme/Magento_Catalog/templates/product/view/gallery.phtml add "maxheight": "550", // Add your value here <script type="text/x-magento-init"> { "[data-gallery-role=gallery-placeholder]": { "mage/gallery/gallery": { "mixins":["magnifier/magnify"], "magnifierOpts": <...


4

You can get the related products of a product by using the below code in your script. try { $configProductIds = [1663]; foreach ($configProductIds as $product_id) { $configProduct = Mage::getModel('catalog/product')->load($product_id); // Get all related product ids of $product_id. $allRelatedProductIds = $...


0

try { $configProductIds = [1663]; //configurable product ids to update images foreach ($configProductIds as $product_id) { $configProduct = Mage::getModel('catalog/product')->load($product_id); $relatedProducts = $configProduct->getRelatedProductCollection(); // No need for this filter as from particular ...


Top 50 recent answers are included