Hot answers tagged

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


1

Magento 2 versions from 2.3 have a replacement for traditional install/upgrade schema which is used to maintain the database structure. From Magento 2 version 2.3, they have introduced the declarative schema file for database (etc/db_schema.xml) which is used to maintain the database structure for a module. Now you can forget about untidy install/upgrade ...


Only top voted, non community-wiki answers of a minimum length are eligible