Hot answers tagged

9

Removing the toolbar can be done in current theme dir by commenting in Magento_Catalog/templates/product/list.phtml the 2 lines with <?php echo $block->getToolbarHtml() ?> To hide it only in category page than wrap getToolbarHtml() with an if statement. <?php if (!$this->getMyHideFlag()): ?> <?php echo $block->getToolbarHtml()...


8

To Turn on Limiter in top toolbar add below css in _extend.less in your custom theme module .page-products .toolbar .limiter { display: block; } To Hide in bottom toolbar .products.wrapper ~ .toolbar .limiter { display: none; } For Adding your custom CSS/LESS or updating existing CSS/LESS use _extend.less Run commands mentioned in above link ...


8

I think it's not moving by using XML, Because It's commenting in module-catalog/templates/product/list.phtml file. <?php echo $block->getToolbarHtml() ?> Also it's define in module-catalog/view/frontend/layout/catalog_category_view.xml category.products.list block <referenceContainer name="content"> <block class="Magento\Catalog\...


8

Try this. 1. Create catalog_category_view file under vendor/magento/theme-frontend-luma/Magento_Catalog/layout <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceContainer name="sidebar....


7

In your template folder (or base if you don't have a custom theme) create the file toolbar-bottom.phtml in catalog/product/list. Then in catalog/product/list.phtml file call your bottom toolbar with: <?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar-bottom.phtml')->toHtml(); ?> If you dont want to change the ...


6

One way of solving your issue is by hiding and showing toolbar HTML elements For top toolbar your CSS should look like the following: .toolbar .pager { display: none; } For bottom toolbar your CSS should look like the following: .toolbar-bottom .toolbar .pager { display: block; } .toolbar-bottom .toolbar .sorter { display: none; } Another ...


5

I tested the best developer toolbars, I'll put down the more I liked it. ADM/QuickDevBar Info : Information about controller, route, action and store. A dedicated tab output a phpinfo. Design : List handles called and display layout structure of nested blocks and containers Profile : View current observers, all events dispatched and collections, models ...


5

Add it to catalog_category_view.xml layout in you custom theme /app/design/frontend/VENDORNAME/THEME/Magento_Catalog/layout‌​/ Then clear cache and toolbar will disappear <referenceBlock name="product_list_toolbar" remove="true" />


5

I created these custom sort by options: price high - low --> (including all forms of discounts) price low - high --> (including all forms of discounts) name a-z name z-a newest oldest by creating a plugin to bypass the default functionality of the product sorter which can be found here: Magento\Catalog\Block\Product\ProductList\Toolbar and Magento\...


4

There are little corrections in your limiter.phtml code and it will be displayed , here is updated file. <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ // @codingStandardsIgnoreFile ?> <?php /** * Product list toolbar * * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar */ ...


4

Try This code Create the custom module. Add this code in catalog_category_view.xml: <referenceContainer name="content"> <block class="{{Package Name}}\{{Your Module Name}}\Block\Toolbar" before="-" name="product_list_custom_toolbar" template="Magento_Catalog::product/list/toolbar.phtml"> <block class="Magento\Theme\...


3

Without editing the template files is not possible. But here is a possible solution to hiding parts of the toolbar or splitting the toolbar in paging and sorting. One at the top and one at the bottom. If you want to hide the full toolbar from the bottom, edit catalog/product/list.phtml and remove the lines <div class="toolbar-bottom"> <?php ...


3

Hello call your create custom toolbar.phtml & call into grid view 1.Comment $this->getToolbarHtml() & add below code <?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/newtoolbar.phtml')->toHtml() ?> 2.Copy content from toolbar.phtml to newtoolbar.phtml (change as your requirement) app/design/frontend/(base ...


3

Remove <?php and ?> <p class="amount"> <?php if($this->getLastPageNum()>1): ?> <?php echo $this->__('Items %s to %s of %s total', $this->getFirstNum(), $this->getLastNum(), $this->getTotalNum()) ?> <?php else: ?> <strong><?php echo $this->__('%s Item(s)', $this->getTotalNum()) ?></...


3

I have created toolbar With my custom below code In my list.phtml <?php echo $this->getToolbarHtml(); ?>// Default way <?php // Custom Way $toolbar = $this->getToolbarBlock(); //$toolbar->setCollection($this->getChild('catalog_product_list')->getLoadedProductCollection()); $toolbar->setCollection($...


3

di.xml override Magento\Catalog\Model\Config.php app\code\[Vendor]\[Module]\etc\frontend\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="Magento\Catalog\Model\Config" type=...


3

You can use below code to show All Product With the toolbar Step- 1 create a custom module create file app\code\Rasik\AllProduct\registration.php <?php /** * Copyright © 2015 Magento. All rights reserved. * See COPYING.txt for license details. */ \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::...


2

If you're just saving the attribute, you should try something like this: $product->setData('product_view_count', $value) ->getResource()->saveAttribute($product, 'product_view_count'); Which will simply save that attribute to the product, rather than attempt to save the entire product.


2

Just change from <div class="sort-by"> <label><?php echo $this->__('Sort By') ?></label> <select onchange="setLocation(this.value)"> <?php foreach($this->getAvailableOrders() as $_key=>$_order): ?> <option value="<?php echo $this->getOrderUrl($_key, '...


2

You are correct with the assumption that you need the toolbar block to access that information. But the event you are currently listening, catalog_product_collection_load_after will only contain the information obtained regarding the product data, not it's representational logic. An alternative approach might be to listen to the event ...


2

I have the same issue and spend many hours trying to solve it. My dev now made a core 'hack' - for those interested; app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php (line 227) /* FIX: SHOW ALL ITEMS */ if($this->getLimit() == 'all'){ $limit = 1000000; } else { $limit = (int)$this->getLimit(); } Beware it's a ...


2

i found the solution. Adding <block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml"> inside <catalog_category_layered> in catalog.xml : <!--Category layered Navigation Layout--> <catalog_category_layered> <reference name="content"> <block type="catalog/category_view" ...


2

Eventually I fixed problem. I deleted {{block type="catalog/product_list" category_id="5" template="catalog/product/list.phtml"}} from content of home page and added in home page to Desigh->Page Layout in the block this: <block type="catalog/product_list" name="featured" template="catalog/product/list.phtml"> <action method="setCategoryId"&...


2

You need to do two things here. 1. Change Form Method to POST File : app\design\frontend\{package|\{theme}\template\catalogsearch/advanced/form.phtml <form action="<?php echo $this->getSearchPostUrl() ?>" method="post" id="form-validate"> Here we just changed form action method to POST. 2.Rewrite controller ...


2

The right methods are getPreviousPageUrl() and getNextPageUrl(): public function getPreviousPageUrl() { return $this->getPageUrl($this->getCollection()->getCurPage(-1)); } public function getNextPageUrl() { return $this->getPageUrl($this->getCollection()->getCurPage(+1)); } However, in your case I'm pretty sure it won't help ...


2

At lib/web/css/source/lib/variables/_typography.less define @text__color__muted: @primary__color__lighter; and value it define at lib/web/css/source/lib/variables/_colors.less


2

You can remove it by overriding the following template /vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar.phtml and comment out the following code <?php if ($block->isExpanded()): ?> <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?> <?php endif; ?...


2

It can be done by replacing the following code in Magento_Catalog/templates/product/list/toolbar/limiter.phtml <select id="limiter" data-role="limiter" class="limiter-options"> <?php foreach ($block->getAvailableLimit() as $_key => $_limit): ?> <option value="<?php /* @escapeNotVerified */ echo $_key ?>"...


2

It is quite easy with Magento 2, if your already have your module declared. Let's imagine i want to add a "Clear Category Cache" button on Category Admin : Admin buttons are declared in "UI Components" file, usually located in vendor/magento/MAGENTO_MODULE/view/adminhtml/ui_component\FILE.xml. For Categories, the file is located in vendor/magento/module-...


2

First you need to create a toolbar object as shown below in your phtml file $toolbar = Mage::getBlockSingleton('catalog/product_list')->getToolbarBlock(); Then Assign product collection to toolbar object $toolbar->setCollection($_productCollection); echo $toolbar->toHtml();


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