This question has been flagged
3 Replies
2801 Views

Hi folks!

Some days ago odoo15 update switched on demonstration of extra price @product variant buttons 

How to hide it (switch off)??

In my case it tripled callcenter request from users(((

Thanx!

Avatar
Discard
Best Answer

Hi !

I'm on Odoo13 but i guess it will be the same !

go to website>then on the page where you have the variant list

Costumise theme > HTML CSS JS Editor

On the very left selectot be in XML (HTML) then in the other selector (on the right of this one) select List view of variants

In the code find this lines



Delete them and it should be ok ;)

I didn't test if it works on all pages because my website isn't set up already, still hope it helps !

I wrote a small HTML page for you to see the steps with pictures, just copy paste link adress as this forum will block all my links 

http://ninjaaior.free.fr/odoo-badge.html

 

Avatar
Discard

<span class="badge badge-pill badge-secondary" t-if="diff_price != 0">
<t t-esc="diff_price &gt; 0 and '+' or '-'"/><span t-esc="abs(combination_info['price'] - template_combination_info['price'])" t-options="{'widget': 'monetary', 'display_currency': website.currency_id}"/>
</span>

Author

wow!
thanx!)
But I have more then 1K products.. do I have to do all this work manually?)
Will wait an official answer)

I really don't know but i think this CSS class is for the whole template, just look if it's still there on other products ;)

I just tested and it works for all products, once you take off the code lines no products will have this badge anymore, enjoy :)

If you could validate the answer it would be great ;) Have a nice day !

Author

Deleted very-very looks alike code) but extra price still there(

The important thing is to be in the List view of variants editing, then look for the span class with "badge badge-pill badge-secondary", delete the whole span tag and save your template, i don't know how to put images here, it never works but i will try o/

Author


<t t-if="ptal.attribute_id.display_type == 'select'">
<select t-att-data-attribute_id="ptal.attribute_id.id" t-attf-class="custom-select css_attribute_select js_variant_change #{ptal.attribute_id.create_variant} #{'d-none' if single_and_custom else ''}" t-att-name="'ptal-%s' % ptal.id">
<t t-foreach="ptal.product_template_value_ids._only_active()" t-as="ptav">
<option t-att-value="ptav.id" t-att-data-value_id="ptav.id" t-att-data-value_name="ptav.name" t-att-data-attribute_name="ptav.attribute_id.name" t-att-data-is_custom="ptav.is_custom" t-att-selected="ptav in combination" t-att-data-is_single="single" t-att-data-is_single_and_custom="single_and_custom">
<span t-field="ptav.name"/>
<span t-if="ptav.price_extra" class="badge badge-pill badge-secondary">
<!--
price_extra is displayed as catalog price instead of
price after pricelist because it is impossible to
compute. Indeed, the pricelist rule might depend on the
selected variant, so the price_extra will be different
depending on the selected combination. The price of an
attribute is therefore variable and it's not very
accurate to display it.
-->
<t t-esc="ptav.price_extra &gt; 0 and '+' or '-'"/>
<span t-esc="abs(ptav.price_extra)" class="variant_price_extra" style="white-space: nowrap;" t-options="{ &quot;widget&quot;: &quot;monetary&quot;, &quot;from_currency&quot;: product.currency_id, &quot;display_currency&quot;: (pricelist or product).currency_id }"/>
</span>
</option>
</t>
</select>
</t>

In the selector you are in "Variants" you need to be in "List view of variants" see the link i put in my answer i made pictures ;)

I'm looking at it, on your version the span class name is "badge badge-pill badge-light border" and in the selector you can find "Template ID: sale.badge_extra_price" in the "Badge Extra Price".

I just commented the content, then in customize you can activate "List view of variants" option so then you can access it's template in the selector, and comment the <span> here too ;)

I commented on both template by adding <!-- -- > in your HTML so you can have a look and can uncomment it if needed, enjoy :)

Author

WOW!!!)
Thank you a lot for time and knowledge.
If some day you will visit Ukraine - let me know ;) I`ll do my best to be your host.
SY,
Val

Best Answer

Hi, It is possible to do this even out of the box without custom code. Please review the following Post.

https://www.odoo.com/forum/help-1/hide-extra-price-badge-on-website-228049

Avatar
Discard
Best Answer

Hey, I tried to follow these steps, but didn't manage to make the badge disappear. What am I missing?

Avatar
Discard