21 votes
Accepted

How to change listing per page option?

Go to admin Store > Configuration > Catalog > Storefront Now there are two things Products per Page on Grid Allowed Values Enter your desired no here with comma like 12,24,48,96 Products ...
Manoj Deswal's user avatar
  • 5,765
13 votes
Accepted

Magento 2 remove category filter from list page filters?

You have to override core file into your theme, Category layered navigation comes form core file, vendor/magento/module-layered-navigation/view/frontend/templates/layer/view.phtml You have to get ...
Rakesh Jesadiya's user avatar
11 votes
Accepted

Add custom block on listing page : Magento2

You can do that if you create new module to override this block: vendor\magento\module-catalog\Block\Product\ListProduct.php to override this block, you need to create di.xml at app\code\Vendor\...
Harry Nguyen's user avatar
  • 2,815
10 votes

Magento 2 remove category filter from list page filters?

Better to use as: <?php if($filter->getRequestVar() != 'cat') { // ... } ?>
MagePsycho's user avatar
  • 4,712
9 votes
Accepted

Uncaught TypeError: url.indexOf is not a function

Cause: Here's jquery 3 release note: https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/ Removed deprecated event aliases (https://github.com/jquery/jquery/issues/2286) .load, .unload, and ...
Mukesh Chapagain's user avatar
8 votes

Remove Compare from Product List in Magento 2.1.6

Update your extended catalog_category_view.xml file and Find it at your extended theme path app/design/frontend/vendorname/themename/Magento_Catalog/layout/catalog_category_view.xml To remove ...
Manoj Deswal's user avatar
  • 5,765
8 votes
Accepted

In magento2,Category Sorting Product list: How to remove position from attributes?

quick workaround can be add a condition in theme templates file Magento_Catalog/templates/product/list/toolbar/sorter.phtml like if $key != 'position' then don't add in drop down options : <...
Naveed Asim's user avatar
  • 3,607
8 votes
Accepted

How to get product video in product listing page in magento 2?

You can get Media collection of particular product by loading it in custom helper as below: <?php namespace Your\Module\Helper; use Magento\Catalog\Api\ProductRepositoryInterface; class Data ...
Himmat Paliwal's user avatar
7 votes

How to get the product collection based on catalog & cart price rules?

For catalog rule, if you look at vendor/magento/module-catalog-rule/Model/Rule You will find method getMatchingProductIds() which return an array of all matching products for a particular rule. So ...
Amit Singh's user avatar
  • 1,735
7 votes
Accepted

how to use different template file for category magento 2

You need to create a xml file catalog_category_view_id_{{id}}.xml under your theme > Magento_Catalog > layout and change list file. For detail : http://sumankc.com/2016/12/10/different-template-for-...
Suman K.C's user avatar
  • 1,159
6 votes
Accepted

Product list by category in CMS page

For Magento 1.9.2.x, You need to create permission for 'catalog/product_list' block from 'System->Permissions->Blocks'
Sohel Rana's user avatar
  • 35.6k
6 votes
Accepted

Change list.phtml to show products of multiple categories in same block

Good question! The trick here is to extend a block based on catalog/product_list. I think the best way here is to add some xml to the "Layout Update XML" section. <reference name="content"> ...
Wouter Steenmeijer's user avatar
6 votes

How to override product list page

You have to just write below xml code in your module file, In your module layout file, app/code/Vendor/Modulename/view/frontend/layout/catalog_category_view.xml File, <?xml version="1.0"?> <...
Rakesh Jesadiya's user avatar
6 votes

Magento 2 remove category filter from list page filters?

Since this is the top result in Google for my search "magento 2 remove category filter from layered navigation", and all the answers suggest entirely replacing a template file (which is subject to ...
John Hall's user avatar
  • 429
6 votes

How to show visual swatch color on product listing page magento2

<?php/***********Display Color Attribute************/?> <?php $om = \Magento\Framework\App\ObjectManager::getInstance(); $attribute = $om->get(\Magento\Catalog\Api\...
Baharuni Asif's user avatar
6 votes
Accepted

I am facing some difficulties while calling .phtml file in list.phtml of magento

The code won't work on list page because, In the reference link, the module is to display custom products which are assigned to a product. It gets data from a singl product and add it to the related ...
Jaimin Sutariya's user avatar
6 votes
Accepted

Magento 2 How can I show custom options on product list page?

I've implement code for it. Please create block class Don't use Object Manager directly on template. I've used this for demo. <?php $_objectManager = \Magento\Framework\App\ObjectManager::...
Kul's user avatar
  • 1,767
6 votes
Accepted

Magento2 : Product list phtml file for each page

So a quick answer on this : You can find the list.phtml in catalog_category_view.xml under the line of <block class="Magento\Catalog\Block\Product\ListProduct" name="category....
CompactCode's user avatar
  • 2,447
5 votes

Magento get products by website id and store id

Try this $websiteIds = array(Mage::app()->getStore()->getWebsiteId()); $storeId = Mage::app()->getStore()->getStoreId(); $collection = Mage::getModel('catalog/product')->getCollection(...
Abdul's user avatar
  • 9,692
5 votes
Accepted

catalog_product_collection_load_after - identify the "right" collection

You can use the event catalog_block_product_list_collection. This one is dispatched in the product list block.
Marius's user avatar
  • 198k
5 votes
Accepted

product ids separate with # on success page

Go to the success page template app/design/frontend/base/default/template/checkout/success.phtml (for base theme) Aafter <?php if ($this->getOrderId()):?> add: <?php $order = ...
Siarhey Uchukhlebau's user avatar
5 votes
Accepted

Moving layered navigation below product toolbar in layout.xml

The solution i came up with is as follows: <move element="catalog.leftnav" destination="category.product.list.additional" before="-"/>
Sophie Baxter's user avatar
5 votes

Returning wishlist item collection for currently logged in user

To do so you need to use the Magento\Wishlist\Controller\WishlistProviderInterface interface. Inject this class in your constructor: protected $wishlistProvider; public function __construct( ......
Raphael at Digital Pianism's user avatar
5 votes

how to use different template file for category magento 2

Created customlist.phtml from list.phtml or copied the code of list.phtml and create Assign customlist.phtml in admin side (admin → category → Layout section) <referenceContainer name="content"&...
Rohit Goel's user avatar
4 votes

Sorting Product List by more than one attribute

Placed into/as answer, as comments will not be appropriate. This expand on the accepted answer: Did I find a bug? magento 1.9.2 If you use the code, as suggested in the accepted answer: $collection-&...
ProxiBlue's user avatar
  • 9,926
4 votes

Magento does not display all imported products within the categories

Possible causes for products that do not appear on the frontend (I include those that you already ruled out for sake of completeness): the products' "visibility" attribute might be set to "Not ...
Fabian Schmengler's user avatar
4 votes

Add custom block on listing page : Magento2

Currently you cannot do this because all logic of product output is hardcoded in list.phtml template.
KAndy's user avatar
  • 20.8k
4 votes

Magento 2 - Quantity Field on Related Products Listing

Replace the content of if ($showCart) ...... endif with below code. <?php if ($showCart): ?> <div class="product actions product-item-actions"> <form data-role="tocart-...
Jarnail S's user avatar
  • 4,687
4 votes

Change configurable swatches order in Magento 2

You have to edit configurable product, in configurable tab (product edit page) you can view option for Edit Configurations. Click on Edit Configurations, you can see select attribute screen, go to ...
Suresh Chikani's user avatar
4 votes

How to retrieve which layered navigation filters are applied in product list page in Magento 2?

You can do this with the layer resolver (Magento\Catalog\Model\Layer\Resolver). Example code: public function __construct( \Magento\Catalog\Model\Layer\Resolver $layerResolver ) { $this->...
Giel Berkers's user avatar
  • 12.2k

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