New answers tagged

1

Go to Magento admin panel Content -> Pages -> Choose your home page Click the Insert Widget button Then choose Catalog Product List Choose condition as category and its ID Save page and Clear the Magento cache then you will see the products in the category


1

If you don't have access to the $collection you can use a jQuery to parse all ids: var productIds = []; jQuery('.product-items').find('[id*=product-item-info_]') .each(function (i, e) { productIds[i] = parseInt(e.id.replace('product-item-info_', '')) }); console.log(productIds); Result: But better way is to take all ids right from the ...


1

If you are on the category page, then you can get collection by : <?php $_productCollection = $block->getLoadedProductCollection(); ?> Where $block is object of \Magento\Catalog\Block\Product\ListProduct


0

If error in indexing after upgrade then run below sql query in phpmyadmin CREATE SQL SECURITY INVOKER VIEW inventory_stock_1 AS SELECT DISTINCT legacy_stock_status.product_id, legacy_stock_status.website_id, legacy_stock_status.stock_id, legacy_stock_status.qty quantity, legacy_stock_status.stock_status is_salable, product.sku FROM ...


0

<?php use Magento\Framework\App\Bootstrap; include("./app/bootstrap.php"); $bootstrap = Bootstrap::create(BP, $_SERVER); $objectManager = $bootstrap->getObjectManager(); $state = $objectManager->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); // add logging capability $writer = new \Zend\Log\Writer\Stream(BP . '/...


Top 50 recent answers are included