Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
185 Vistas

Currently the product category Breadcrumb display the selected category itself as follows

Home / products / selected category

I need to add the parent category as follows:

Home / products / parent category ( if founded ) / selected category

We use odoo 16


Here is the code

<t name="Products Breadcrumb" t-name="website_sale.products_breadcrumb">
        <ol t-if="category" t-attf-class="breadcrumb #{_classes}">
            <li class="breadcrumb-item">
                <a href="/shop">Products</a>
            </li>
            <t t-foreach="category.parents_and_self" t-as="cat">
                <li t-if="cat == category" class="breadcrumb-item">
                    <span class="d-inline-block" t-field="cat.name"/>
                </li>
                <li t-else="" class="breadcrumb-item">
                    <a t-att-href="keep('/shop/category/%s' % slug(cat), category=0)" t-field="cat.name"/>
                </li>
            </t>
        </ol>
    </t>

Can any one help in this code?

Thanks in advance

Avatar
Descartar
Autor Mejor respuesta

Is that possible or not ?

Avatar
Descartar