This question has been flagged
1 Reply
3154 Views

Hello,
When I am adding a product to quotation straight from quotation it shows discount but when I trying to achieve this from online shop it shows on the quotation:

Where I can find a method which is adding a product to cart from product page?
I found the button code:
<a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#">Add to Cart</a>
I am new in odoo websites and I am still learning so this is hard for me to understand this code. I thought that odoo is clear and simple for me after a year of learning (python, xml) but websites are more complex and I have to learn more about javascript.


Avatar
Discard
Best Answer

odoo discounts come from pricelists. Under website_sale module template.xml file you will find this piece of code:


<t t-if="(compute_currency(product.lst_price) - product.website_price ) &gt; 0.01 and website.get_current_pricelist().discount_policy=='without_discount'">
    <del class="text-danger mr8" style="white-space: nowrap;" t-esc="compute_currency(product.website_public_price)" t-options="{'widget': 'monetary', 'display_currency': website.get_current_pricelist().currency_id, 'from_currency': website.currency_id}" />
</t>

You will find this code block for website prices in the module GITHUB: https://github.com/odoo/odoo/blob/10.0/addons/website_sale/views/templates.xml#L103-L113


Avatar
Discard