TransWikia.com

Show category names in breadcrumb in product page magento 2.3.2

Magento Asked by Nafsss on November 27, 2021

How can i show full category names in breadcrumb on product details page.
Currently it is coming like https://www.screencast.com/t/5o9uZEu8xnV
I want like this https://www.screencast.com/t/1pfZkoVSWLov

2 Answers

Simply you install this extension.

After Install extension run below commands :-

php bin/magento s:up
php bin/magento s:s:d -f
php bin/magento c:c
php bin/magento c:f

After you install you got this error like :-

Notice: Undefined index: id in E:xampphtdocsmagentovendormagentomodule-configModelConfigStructureElementIterator.php on line 63

How to solve this error follow this step

1.) Go to this path :- app/code/Eadesigndev/FullBreadcrumbs/etc/adminhtml and Open the system.xml file.

2.) Change this code like :-

In section tag above add this code

<tab id="eadesign_extensions" translate="label" sortOrder="2000">
  <label>Custom Tab</label>
</tab>

UPDATE

<?xml version="1.0"?>
<config
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <tab id="eadesign_extensions" translate="label" sortOrder="2000">
            <label>Custom Tab</label>
        </tab>
        <section id="ea_fullbreadcrumbs" sortOrder="150" type="text" showInDefault="1" showInWebsite="1"
                 showInStore="1">
            <label>Full Breadcrumbs</label>
            <tab>eadesign_extensions</tab>
            <resource>Eadesigndev_FullBreadcrumbs::fullbreadcrumbs_configuration</resource>
            <group id="fullbreadcrumbs" translate="label" sortOrder="10" type="text" showInDefault="1" showInWebsite="1"
                   showInStore="1">
                <label>Full Breadcrumbs</label>
                <field id="enabled" translate="label" sortOrder="10" type="select" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    <label>Enable</label>
                    <source_model>MagentoConfigModelConfigSourceYesno</source_model>
                </field>
                <field id="bad_categories" translate="label comment" sortOrder="20" showInDefault="1" showInWebsite="1"
                       showInStore="1">
                    <label>Exluded categories</label>
                    <comment>Enter the IDs of the categories that will be excluded from Full Breadcrumbs. ex:
                        4,12,15,14,78
                    </comment>
                </field>
            </group>
        </section>
    </system>
</config>

And After you chnage run below command :-

php bin/magento c:c
php bin/magento c:f

Thanks .

Answered by Mohit Patel on November 27, 2021

To display category name in bread cums you have to override block breadcrumbs of default magento to your module.

You can override block with reference block using layout file. like below.

add layout file catalog_product_view.xml in your module Path should be: appcodeVendorModuleviewfrontendlayoutcatalog_product_view.xml

<?xml version="1.0"?>
<page>
    <body>
    <referenceBlock name="breadcrumbs" remove="true" />
    <referenceContainer name="page.top">
        <block class="VendorModuleBlockCrumbblock" name="crumbs" as="crumbs" template="Vendor_Module::crumbs.phtml" />
    </referenceContainer>
    </body>
</page>

Check this reference link for more details.

Answered by Chirag Patel on November 27, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP