Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][FIX]website_sale_hide_price: improve button visibility logic #987

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions website_sale_hide_price/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@
}
)
return results_data

def _website_show_quick_add(self):
website_show_price = (

Check warning on line 60 in website_sale_hide_price/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

website_sale_hide_price/models/product_template.py#L60

Added line #L60 was not covered by tests
self.env["website"].get_current_website().website_show_price
)
return (

Check warning on line 63 in website_sale_hide_price/models/product_template.py

View check run for this annotation

Codecov / codecov/patch

website_sale_hide_price/models/product_template.py#L63

Added line #L63 was not covered by tests
website_show_price and not self.website_hide_price
) and super()._website_show_quick_add()
8 changes: 0 additions & 8 deletions website_sale_hide_price/views/website_sale_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@
</attribute>
</xpath>
</template>
<!-- Hide add to cart button if "Add to cart" option is enabled and not website_show_price -->
<template id="products_add_to_cart" inherit_id="website_sale.products_add_to_cart">
<xpath expr="//a[hasclass('a-submit')]" position="attributes">
<attribute name="t-if">
website.website_show_price and not product.website_hide_price
</attribute>
</xpath>
</template>
<template id="website_search_box" inherit_id="website.website_search_box">
<xpath expr="//input[@name='search']" position="attributes">
<attribute
Expand Down
Loading