[FIX] website_sale: add to cart with optional products
When clicking on button "add_to_cart" for a product with several options, the user must be redirected to the product page. In this way, the user can choose the options, he wants to buy with the product before adding the product in the cart. opw:653356
This commit is contained in:
parent
a69205d561
commit
4324891529
|
@ -116,10 +116,10 @@
|
|||
<template id="products_add_to_cart" inherit_id="website_sale.products_item" active="False" customize_show="True" name="Add to Cart">
|
||||
<xpath expr="//div[@class='product_price']" position="inside">
|
||||
<input name="product_id" t-att-value="product.product_variant_ids[0].id" type="hidden"/>
|
||||
<t t-if="len(product.product_variant_ids) == 1">
|
||||
<t t-if="len(product.product_variant_ids) == 1 and not len(product.optional_product_ids) >= 1">
|
||||
<a class="btn btn-default btn-xs fa fa-shopping-cart a-submit"/>
|
||||
</t>
|
||||
<t t-if="len(product.product_variant_ids) > 1">
|
||||
<t t-if="len(product.product_variant_ids) > 1 or len(product.optional_product_ids) >= 1">
|
||||
<a class="btn btn-default btn-xs fa fa-shopping-cart" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']>1 else None))"/>
|
||||
</t>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in New Issue