Help

欢迎!

该社区面向专业人士和我们产品和服务的爱好者。
分享和讨论最好的内容和新的营销理念,建立您的专业形象,一起成为更好的营销人员。


0

@V15 How to remove variant extra price from button on eShop?

Avatar
odoo
Avatar
Discard
2 Answers
0
Avatar
odoo
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

 

11 Comments
Avatar
Discard
Avatar
odoo
-

<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>

Avatar
odoo
-

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

Avatar
odoo
-

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 ;)

Avatar
odoo
-

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

Avatar
odoo
-

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

Avatar
odoo
-

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

Avatar
odoo
-

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/

Avatar
odoo
-


<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>

Avatar
odoo
-

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 ;)

Avatar
odoo
-

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 :)

Avatar
odoo
-

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

0
Avatar
odoo
Best Answer

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

Avatar
Discard