4

How can I move these two sections in breadcrumbs? enter image description here

2

Copy the below file to your theme:

vendor/magento/module-catalog/view/frontend/layout/catalog_category_view.xml

and change:

<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
    <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
</block>

to:

<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
    <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs" before="-"/>
    <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
</block>

and then copy the below file to your theme:

vendor/magento/module-catalog/view/frontend/templates/product/list/toolbar.phtml

and update the code with below:

<?php
/**
 * Product list toolbar
 *
 * @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar
 */
use Magento\Catalog\Model\Product\ProductList\Toolbar;
?>
<?php if ($block->getCollection()->getSize()): ?>
    <div class="toolbar toolbar-products" data-mage-init='<?= /* @escapeNotVerified */ $block->getWidgetOptionsJson() ?>'>
        <?= $this->getChildHtml('breadcrumbs') ?>
        <?php if ($block->isExpanded()): ?>
            <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/viewmode.phtml')) ?>
        <?php endif; ?>

        <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/amount.phtml')) ?>

        <?= $block->getPagerHtml() ?>

        <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/limiter.phtml')) ?>

        <?php if ($block->isExpanded()): ?>
            <?php include ($block->getTemplateFile('Magento_Catalog::product/list/toolbar/sorter.phtml')) ?>
        <?php endif; ?>
    </div>
<?php endif ?>

Similarly, you can do for Per Page section.

0

You can override template, then you may not need to add it in xml, just copy the breadcrumb.phtml file to your theme's directory and you can modify it in your theme.

You can put your breadcrumb.phtml file at below path.

app\design\frontend\<VENDOR_NAME>\<THEME_NAME>\Magento_Theme\templates\html\
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.