Skip to content
Closed
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
3 changes: 3 additions & 0 deletions addons/website_sale/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ def _get_additionnal_combination_info(self, product_or_template, quantity, date,
'taxes': taxes, # taxes after fpos mapping
})

if combination_info['prevent_zero_price_sale']:
combination_info['compare_list_price'] = 0

if pricelist.discount_policy != 'without_discount':
# Leftover from before cleanup, different behavior between ecommerce & backend configurator
# probably to keep product sales price hidden from customers ?
Expand Down
8 changes: 7 additions & 1 deletion addons/website_sale/views/templates.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,13 @@
</template>

<template id="product_price">
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" t-attf-class="product_price mt-2 mb-3 {{'d-none' if combination_info['prevent_zero_price_sale'] else 'd-inline-block'}}">
<div
t-if="not combination_info['prevent_zero_price_sale']"
itemprop="offers"
itemscope="itemscope"
itemtype="http://schema.org/Offer"
t-attf-class="product_price mt-2 mb-3 d-inline-block"
>
Comment on lines +1321 to +1327
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will also hide rental/subscription prices if the product sales price is 0 👀 (and the rental/sub prices aren't).
I believe we should update the overrides of _get_combination_info in website_sale_subscription and website_sale_renting to update prevent_zero_price_sale (it seems they never considered it at all :D).

Copy link
Contributor Author

@livaios livaios Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for website_sale_renting they hide the div anyways if its rental so there's no impact there

<xpath expr="//div[@itemprop='offers']" position="attributes">
        <attribute name="t-attf-class" separator=" " add="{{'o_hidden' if combination_info.get('is_rental') else ''}}"/>
</xpath>

I will add a check in website_sale_subscription so I can either leave website_sale_rental untouched or I can add the same check for consistency there as well what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there is no issue with rental 👌
If it's not too complex, I'd say that the same check could be added in both modules to keep both logics similar.

<h3 class="css_editable_mode_hidden">
<span class="oe_price"
style="white-space: nowrap;"
Expand Down