Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
1033 Prikazi

The standard odoo webshop has support for e-commerce categories that are hierarchically organized. In the demo data for example you have

All products > Furnitures > Chairs


When you surf to /shop/category/furnitures-chairs-11


you see this reflected in the breadcrumb on top.

Yet when you select one of the products. For example the Conference chair, you see suddenly the 'Furnitures' item goes missing from the breadcrumb

/shop/conference-chair-16?category=11#attr=5

It shows only

 All Products > Chairs > Conference Chair


This is not what one would expect from a breadcrumb ... 


Any idea how to fix this ?

Avatar
Opusti
Avtor Best Answer

Hmm that was actually easier than i first thought. Seems like there are 2 places where a breadcrumb is generated and they are not in sync ...

This fixes the breadcrumb behavior for the product page:

    <template id="product" inherit_id="website_sale.product">
        <xpath expr="//li[@t-if='category']" position="replace">
            <t t-if="category and category.parents_and_self">
                <t t-foreach="category.parents_and_self" t-as="cat">
                    <li class="breadcrumb-item">
                        <a t-att-href="keep('/shop/category/%s' % slug(cat), category=0)" t-field="cat.name"/>
                    </li>
                </t>
            </t>
        </xpath>
    </template>


Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
jun. 25
1968
3
jul. 25
3554
1
maj 25
1674
1
maj 25
1918
4
maj 25
3039