Skip to content

Commit

Permalink
[FIX][11.0][website_sale_hide_price] Disable Add to cart option to pr…
Browse files Browse the repository at this point in the history
…event show prices in cart (OCA#244)

* Add to cart hidden if not website_show_price
* Hide quantity selector
* bump version and added contributor
  • Loading branch information
JuanjoA authored and JrAdhoc committed Dec 16, 2022
1 parent 8fbacf5 commit 3291534
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions website_sale_hide_price/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Contributors

* David Vidal <david.vidal@tecnativa.com>
* Abraham González <abraham@trey.es>
* Juanjo Algaz <jalgaz@gmail.com>

Maintainer
----------
Expand Down
2 changes: 1 addition & 1 deletion website_sale_hide_price/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Website Sale Hide Price',
'version': '11.0.1.0.0',
'version': '11.0.1.0.1',
'category': 'Website',
'author': 'Tecnativa, '
'Odoo Community Association (OCA)',
Expand Down
13 changes: 13 additions & 0 deletions website_sale_hide_price/views/website_sale_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,17 @@
</attribute>
</xpath>
</template>
<!-- Hide Add To Cart Button and quantity selector if not website_show_price -->
<template id="product" inherit_id="website_sale.product">
<xpath expr="//a[@id='add_to_cart']" position="attributes">
<attribute name="t-if">
website.website_show_price
</attribute>
</xpath>
<xpath expr="//div[hasclass('css_quantity')]" position="attributes">
<attribute name="t-if">
website.website_show_price
</attribute>
</xpath>
</template>
</odoo>

0 comments on commit 3291534

Please sign in to comment.