This question has been flagged
8688 Views

    Hello everyone, I'm creating an e-commerce website with odoo11 version. In shop page the categories are displaying with toggle structure. But in product page there is no such facility to collapsing the products e-commerce categories. I added some code in addons/website_sale/templates.xml file. I.e, inside the product template. And the categories are displaying but they are not toggling. And one more thing i noticed that if we are in shop page the products e-commerce categories are displaying suppose we toggled categories with customizing option But not in the case of product page. If some one knows about the customizing the product page. Please help me...

<!-- addons/website_sale/templates.xml file in Odoo-11 version -->

<template id="product" name="Product">

     <t t-call="website.layout">

          <t t-set="additional_title" t-value="product.name" />

          <div itemscope="itemscope" itemtype="http://schema.org/Product" id="wrap" class="js_sale">

               <section t-attf-class="container mt8 oe_website_sale #{(compute_currency(product.lst_price) -                                          product.website_price)  &gt; 0.01 and website.get_current_pricelist().discount_policy == 'without_discount'                      and 'discount'}" id="product_detail">

                <div class="row">

                <div class="col-sm-8">

                   <ol class="breadcrumb">

                     <li>

                         <a t-att-href="keep(category=0)">Products</a>

                     </li>

                     <li t-if="category">

                         <a t-att-href="keep('/shop/category/%s' % slug(category), category=0)" t-field="category.name"/>

                     </li>

                    <li class="active">

                      <span t-field="product.name"/>

                     </li>

                  </ol>

              </div>

              <div class="col-md-4 mb4">

                  <t t-call="website_sale.search"/>

              </div>    

              <div id="website_published_button" class="col-sm-3"> </div>

              <div class="col-sm-2 text-right">

                  <t t-call="website_sale.pricelist_list"/>

              </div>

           </div>

         <!-- I added some code here -- >

          <div class="row">

            <div class="col-sm-3">

            <ul class="nav nav-pills nav-stacked mt16">

              <li t-att-class=" '' if category else 'active' ">

                <a t-att-href="keep('/shop',category=0)" class="o_not_editable">All Products</a>

              </li>

              <t t-foreach="categories" t-as="c">

                <t t-call="website_sale.categories_recursive"/>

              </t>

            </ul>

              </div>

           ---------------------------------------------

           ---------------------------------------------

        </div>    

    </t>

</template>


Avatar
Discard