تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1032 أدوات العرض

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 ?

الصورة الرمزية
إهمال
الكاتب أفضل إجابة

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>


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 25
1966
3
يوليو 25
3553
1
مايو 25
1674
1
مايو 25
1916
4
مايو 25
3039