[FIX] website_sale: discount price is never hide
This commit is contained in:
parent
ebd74cedcc
commit
162ee61d4f
|
@ -333,6 +333,14 @@ label.css_attribute_color.css_not_available {
|
||||||
max-height: 500px;
|
max-height: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.oe_default_price {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.discount .oe_default_price {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
/* ---- Publish managment and options ---- */
|
/* ---- Publish managment and options ---- */
|
||||||
#products_grid .css_options {
|
#products_grid .css_options {
|
||||||
display: none;
|
display: none;
|
||||||
|
|
|
@ -282,6 +282,11 @@ label.css_attribute_color.css_not_available
|
||||||
display: block
|
display: block
|
||||||
max-height: 500px
|
max-height: 500px
|
||||||
|
|
||||||
|
.oe_default_price
|
||||||
|
display: none
|
||||||
|
.discount .oe_default_price
|
||||||
|
display: block
|
||||||
|
|
||||||
/* ---- Publish managment and options ---- */
|
/* ---- Publish managment and options ---- */
|
||||||
|
|
||||||
#products_grid .css_options
|
#products_grid .css_options
|
||||||
|
|
|
@ -102,7 +102,11 @@ $('.oe_website_sale').each(function () {
|
||||||
if (_.isEqual(variant_ids[k][1], values)) {
|
if (_.isEqual(variant_ids[k][1], values)) {
|
||||||
$price.html(price_to_str(variant_ids[k][2]));
|
$price.html(price_to_str(variant_ids[k][2]));
|
||||||
$default_price.html(price_to_str(variant_ids[k][3]));
|
$default_price.html(price_to_str(variant_ids[k][3]));
|
||||||
$default_price.parent().toggle(variant_ids[k][3]-variant_ids[k][2]>0.2);
|
if (variant_ids[k][3]-variant_ids[k][2]>0.2) {
|
||||||
|
$default_price.closest('.oe_website_sale').addClass("discount");
|
||||||
|
} else {
|
||||||
|
$default_price.closest('.oe_website_sale').removeClass("discount");
|
||||||
|
}
|
||||||
product_id = variant_ids[k][0];
|
product_id = variant_ids[k][0];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="container oe_website_sale" id="product_detail">
|
<section t-attf-class="container oe_website_sale #{(website.compute_curency(product.lst_price) - product.price) > 0.1 and 'discount'}" id="product_detail">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-7 col-md-7 col-lg-7">
|
<div class="col-sm-7 col-md-7 col-lg-7">
|
||||||
<span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
|
<span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
|
||||||
|
@ -435,7 +435,7 @@
|
||||||
<template id="product_price">
|
<template id="product_price">
|
||||||
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
|
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
|
||||||
<h4 class="oe_price_h4 css_editable_mode_hidden">
|
<h4 class="oe_price_h4 css_editable_mode_hidden">
|
||||||
<span class="text-danger oe_default_price" t-att-style="'' if (website.compute_curency(product.lst_price) - product.price) > 0.1 else 'display: none;'" style="text-decoration: line-through; white-space: nowrap;"
|
<span class="text-danger oe_default_price" style="text-decoration: line-through; white-space: nowrap;"
|
||||||
t-field="product.lst_price"
|
t-field="product.lst_price"
|
||||||
t-field-options='{
|
t-field-options='{
|
||||||
"widget": "monetary",
|
"widget": "monetary",
|
||||||
|
|
Loading…
Reference in New Issue