{"id":177987,"date":"2019-06-07T08:07:04","date_gmt":"2019-06-07T08:07:04","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=177987"},"modified":"2024-07-24T13:47:15","modified_gmt":"2024-07-24T13:47:15","slug":"adding-toolbar-in-custom-product-list-page","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/","title":{"rendered":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2"},"content":{"rendered":"<p class=\"moz-quote-pre\">In this blog, we will learn about Custom Attribute Filter In Product Collection in <a href=\"https:\/\/webkul.com\/blog\/magento-tutorial\/\" target=\"_blank\" rel=\"noopener\">Magento 2<\/a>.<\/p>\n<p>Sometimes, we need to add a custom attribute filter in the product list but we can&#8217;t apply the attribute filter directly.<\/p>\n<p>Because when the product collection loads there is an <a href=\"https:\/\/developer.adobe.com\/commerce\/php\/development\/components\/events-and-observers\/\" target=\"_blank\" rel=\"noopener\">event<\/a> <strong>&#8216;catalog_block_product_list_collection&#8217;<\/strong> fired, and an observer <strong>Magento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver<\/strong> executes and it overrides the applied filter.<\/p>\n<p class=\"moz-quote-pre\">So, to apply the custom attribute filter, we create a plugin of the execute method of <strong>CatalogBlockProductCollectionBeforeToHtmlObserver<\/strong> class.<\/p>\n<p><strong>Note: <\/strong>We can directly add custom attribute filter in Magento version &lt; 2.2.0<br \/>So, this process is for Magento version &gt; 2.2.*<strong><br \/><\/strong><\/p>\n<p class=\"moz-quote-pre\">So, to add a custom attribute filter, follow the following steps one by one.<\/p>\n<p>1. Create CustomProductList.php file inside Vendor_Module\/Block.<\/p>\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\Module\\Block;\nuse Magento\\Catalog\\Block\\Product\\ListProduct;\nuse Magento\\Catalog\\Model\\ResourceModel\\Collection\\AbstractCollection;\nuse Magento\\Catalog\\Api\\CategoryRepositoryInterface;\nclass CustomProductList extends ListProduct\n{\npublic function __construct(\n\\Magento\\Catalog\\Block\\Product\\Context $context,\n\\Magento\\Framework\\Data\\Helper\\PostHelper $postDataHelper,\n\\Magento\\Catalog\\Model\\Layer\\Resolver $layerResolver,\nCategoryRepositoryInterface $categoryRepository,\n\\Magento\\Framework\\Url\\Helper\\Data $urlHelper\n) {\nparent::__construct(\n$context,\n$postDataHelper,\n$layerResolver,\n$categoryRepository,\n$urlHelper\n);\n}\n\/**\n* @return Magento\\Eav\\Model\\Entity\\Collection\\AbstractCollection\n*\/\nprotected function _getProductCollection()\n{\nreturn parent::_getProductCollection();\n}\n}<\/pre>\n\n\n<p>2. Create Index.php file inside Vendor_Module\/Controller\/CustomProductList<\/p>\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\Module\\Controller\\CustomProductList;\nuse Magento\\Framework\\App\\Action\\Action;\nuse Magento\\Framework\\App\\Action\\Context;\nuse Magento\\Framework\\View\\Result\\PageFactory;\nclass Index extends Action\n{\n\/** @varPageFactory *\/\nprotected $pageFactory;\n\/** @var \\Magento\\Catalog\\Model\\ResourceModel\\Product\\Collection *\/\nprotected $productCollection;\npublic function __construct(\nContext $context,\nPageFactory $pageFactory\n) {\n$this-&gt;pageFactory = $pageFactory;\nparent::__construct($context);\n}\npublic function execute()\n{\n$result = $this-&gt;pageFactory-&gt;create();\nreturn $result;\n}\n}<\/pre>\n\n\n<p>3. Create layout file routename_controllername_actionname.xml (for example: demo_customproductlist_index.xml) file inside Vendor_Module\/view\/frontend.<\/p>\n\n\n<pre class=\"EnlighterJSRAW\">&lt;page xmlns:xsi=\u201dhttp:\/\/www.w3.org\/2001\/XMLSchema-instance\u201d layout=\u201d2columns-left\u201d\nxsi:noNamespaceSchemaLocation=\u201durn:magento:framework:View\/Layout\/etc\/page_configuration.xsd\u201d&gt;\n&lt;head&gt;\n&lt;title&gt;Custom Product List&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;referenceContainer name=\u201dcontent\u201d&gt;\n&lt;block class=\u201dVendor\\Module\\Block\\CustomProductList\u201d name=\u201dcustom.products.list\u201d as=\u201dproduct_list\u201d template=\u201dMagento_Catalog::product\/list.phtml\u201d&gt;\n&lt;container name=\u201dcategory.product.list.additional\u201d as=\u201dadditional\u201d \/&gt;\n&lt;block class=\u201dMagento\\Framework\\View\\Element\\RendererList\u201d name=\u201dcategory.product.type.details.renderers\u201d as=\u201ddetails.renderers\u201d&gt;\n&lt;block class=\u201dMagento\\Framework\\View\\Element\\Template\u201d as=\u201ddefault\u201d\/&gt;\n&lt;\/block&gt;\n&lt;block class=\u201dMagento\\Catalog\\Block\\Product\\ProductList\\Item\\Container\u201d name=\u201dcategory.product.addto\u201d as=\u201daddto\u201d&gt;\n&lt;block class=\u201dMagento\\Catalog\\Block\\Product\\ProductList\\Item\\AddTo\\Compare\u201d\nname=\u201dcategory.product.addto.compare\u201das=\u201dcompare\u201d\ntemplate=\u201dMagento_Catalog::product\/list\/addto\/compare.phtml\u201d\/&gt;\n&lt;\/block&gt;\n&lt;block class=\u201dMagento\\Catalog\\Block\\Product\\ProductList\\Toolbar\u201d name=\u201dproduct_list_toolbar\u201d template=\u201dMagento_Catalog::product\/list\/toolbar.phtml\u201d&gt;\n&lt;block class=\u201dMagento\\Theme\\Block\\Html\\Pager\u201d name=\u201dproduct_list_toolbar_pager\u201d\/&gt;\n&lt;\/block&gt;\n&lt;action method=\u201dsetToolbarBlockName\u201d&gt;\n&lt;argument name=\u201dname\u201d xsi:type=\u201dstring\u201d&gt;product_list_toolbar&lt;\/argument&gt;\n&lt;\/action&gt;\n&lt;\/block&gt;\n&lt;\/referenceContainer&gt;\n&lt;\/body&gt;\n&lt;\/page&gt;<\/pre>\n\n\n<p>4. Now, we will create the Plugin of CatalogBlockProductCollectionBeforeToHtmlObserver Class, in which we add the custom attribute filter. Here, we add a check for controller action name to avoid this filter in other product lists.<\/p>\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\n\/**\n* Webkul Software.\n*\n* @category Webkul\n* @package Vendor_Module\n* @author Webkul\n* @copyright Copyright (c) Webkul Software Private Limited (https:\/\/webkul.com)\n* @license https:\/\/store.webkul.com\/license.html\n*\/\nnamespace Vendor\\Module\\Plugin;\nuse \\Magento\\Framework\\App\\Helper\\Context;\nclass CatalogBlockProductCollectionBeforeToHtmlObserver\n{\n\/**\n* Review model\n*\n* @var \\Magento\\Review\\Model\\ReviewFactory\n*\/\nprotected $_reviewFactory;\nprotected $_request;\n\/**\n* @param Context $context\n* @param \\Magento\\Framework\\App\\RequestInterface $request\n* @param \\Magento\\Review\\Model\\ReviewFactory $reviewFactory\n*\/\npublic function __construct(\nContext $context,\n\\Magento\\Framework\\App\\RequestInterface $request,\n\\Magento\\Review\\Model\\ReviewFactory $reviewFactory\n) {\n$this-&gt;_reviewFactory = $reviewFactory;\n$this-&gt;_request = $request;\n}\n\npublic function aroundExecute(\n\\Magento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver $subject,\ncallable $proceed,\n\\Magento\\Framework\\Event\\Observer $observer\n) {\n$productCollection = $observer-&gt;getEvent()-&gt;getCollection();\nif ($this-&gt;_request-&gt;getFullActionName() ==\u201ddemo_customproductlist_index\u201d) {\n$productCollection-&gt;addAttributeToFilter(\u2018as_featured\u2019, 1); \/\/adding custom attribute filter in product collection\n}\nif ($productCollection instanceof \\Magento\\Framework\\Data\\Collection) {\n$productCollection-&gt;load();\n$this-&gt;_reviewFactory-&gt;create()-&gt;appendSummary($productCollection);\n}\nreturn $this;\n}\n}<\/pre>\n\n\n<p>5. Finally, we mention this plugin in the di.xml file.<\/p>\n\n\n<pre class=\"EnlighterJSRAW\">&lt;&lt;span style=&quot;background-color: initial;font-family: inherit;font-size: inherit;color: initial&quot;&gt;?xml version=\u201d1.0\u2033?&gt; &lt;\/span&gt;\n&lt;code&gt;&lt;config xmlns:xsi=\u201dhttp:\/\/www.w3.org\/2001\/XMLSchema-instance\u201d xsi:noNamespaceSchemaLocation=\u201durn:magento:framework:ObjectManager\/etc\/config.xsd\u201d&gt;&lt;type name=\u201dMagento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver\u201d&gt; &lt;plugin name=\u201dVendor_Module::aroundExecute\u201d type=\u201dVendor\\Module\\Plugin\\CatalogBlockProductCollectionBeforeToHtmlObserver\u201d sortOrder=\u201d10\u2033 \/&gt; &lt;\/type&gt; &lt;\/config&gt;&lt;\/code&gt;<\/pre>\n\n\n<p>Additionally, In the above example, I have used the \u201cas_featured\u201d custom attribute. You can create your custom attribute as per your requirement using Setup files or from the admin section.<\/p>\n<p>That&#8217;s all about Custom Attribute Filter In Product Collection in Magento 2.<br \/>Hope, it will be helpful. Thanks \ud83d\ude42<\/p>\n<div id=\"attachment_178289\" style=\"width: 1299px\" class=\"wp-caption alignnone\"><img decoding=\"async\" aria-describedby=\"caption-attachment-178289\" class=\"wp-image-178289 size-full\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\" alt=\"customproductlist\" width=\"1289\" height=\"644\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png 1289w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist-250x125.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist-300x150.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist-768x384.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist-1200x600.png 1200w\" sizes=\"(max-width: 1289px) 100vw, 1289px\" loading=\"lazy\" \/><p id=\"caption-attachment-178289\" class=\"wp-caption-text\">Custom product Collection<\/p><\/div>\n\n\n<p><strong>Previous Blog:<\/strong> <a href=\"https:\/\/webkul.com\/blog\/inspecting-developer-tools-in-ipad-device\/\" target=\"_blank\" rel=\"noreferrer noopener\">Inspecting developer tools in iPad Device<\/a><br><br><strong>Next Blog:<\/strong> <a href=\"https:\/\/webkul.com\/blog\/profiler-in-magento-2\/\" target=\"_blank\" rel=\"noreferrer noopener\">Profiler in Magento 2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we will learn about Custom Attribute Filter In Product Collection in Magento 2. Sometimes, we need to add a custom attribute filter in the product list but we can&#8217;t apply the attribute filter directly. Because when the product collection loads there is an event &#8216;catalog_block_product_list_collection&#8217; fired, and an observer Magento\\Review\\Observer\\CatalogBlockProductCollectionBeforeToHtmlObserver executes and <a href=\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,302,13],"tags":[354,353,388,42,8808],"class_list":["post-177987","post","type-post","status-publish","format-standard","hentry","category-magento","category-magento2","category-php","tag-attribute","tag-custom","tag-observer","tag-plugin","tag-toolbar"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-07T08:07:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-24T13:47:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\" \/>\n<meta name=\"author\" content=\"Khushboo Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khushboo Sahu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2\",\"datePublished\":\"2019-06-07T08:07:04+00:00\",\"dateModified\":\"2024-07-24T13:47:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\"},\"wordCount\":280,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\",\"keywords\":[\"Attribute\",\"Custom\",\"OBSERVER\",\"plugin\",\"toolbar\"],\"articleSection\":[\"magento\",\"Magento2\",\"php\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\",\"url\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\",\"name\":\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\",\"datePublished\":\"2019-06-07T08:07:04+00:00\",\"dateModified\":\"2024-07-24T13:47:15+00:00\",\"description\":\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png\",\"width\":1289,\"height\":644,\"caption\":\"customproductlist\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog","description":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/","og_locale":"en_US","og_type":"article","og_title":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog","og_description":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection","og_url":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2019-06-07T08:07:04+00:00","article_modified_time":"2024-07-24T13:47:15+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2","datePublished":"2019-06-07T08:07:04+00:00","dateModified":"2024-07-24T13:47:15+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/"},"wordCount":280,"commentCount":2,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png","keywords":["Attribute","Custom","OBSERVER","plugin","toolbar"],"articleSection":["magento","Magento2","php"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/","url":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/","name":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png","datePublished":"2019-06-07T08:07:04+00:00","dateModified":"2024-07-24T13:47:15+00:00","description":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2, , implementation of custom filter with custom product collection","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2019\/06\/customproductlist.png","width":1289,"height":644,"caption":"customproductlist"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/adding-toolbar-in-custom-product-list-page\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Implement Custom Attribute Filter In Custom Product Collection Page In Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/177987","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=177987"}],"version-history":[{"count":40,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/177987\/revisions"}],"predecessor-version":[{"id":454579,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/177987\/revisions\/454579"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=177987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=177987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=177987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}