Hot answers tagged

17

You can do this by modifying catalog/product/list.phtml and catalog/prodct/list/toolbar.phtml from your theme. First, the changes in catalog/product/list/toolbar.phtml. Wrap the div with class pager in this if statement (the full div element not just the tag opening line): <?php if (!$this->getHidePager()) : ?> <!-- <div class="pager"&...


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

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 ...


6

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 ...


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 ...


4

It's not reset. The block is cached. In product/list.phtml this is called <?php echo $this->getToolbarHtml() ?> which is the same thing as $this->getChildHtml('toolbar'). The method getChildHtml has 2 parameters: public function getChildHtml($name = '', $useCache = true, $sorted = false) The second parameter $useCache defaults to true (see ...


4

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

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

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

Another way to change top toolbar template from product listing replace below code: Instead of: <?php echo $this->getToolbarHtml() ?> We can add this: <?php echo $this->getToolbarBlock()->setTemplate('catalog/product/list/toolbar-top.phtml')->toHtml(); ?> Create new template as toolbar-top.phtml and comment pager code snippet.


3

The catalog (category) and catalogsearch (results) contexts use the same block classes and templates. Unfortunately there are no public methods for setting/adjusting the _availableModes property after it's been set - which it is in the constructor for Mage_Catalog_Block_Product_List_Toolbar. (There is a setModes() method but it does nothing once the property ...


3

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" />


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($...


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

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

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

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();


2

Adding ?p=2 to the end of your url works fine, so that shows us that the pagination is active, it's just the block not displaying. Infinite scroll extensions typically 'click' the pagination in the background, hence that one not working for you Do you have this code in list.phtml? <div class="toolbar-bottom"> <?php echo $this->...


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