[FIX] website_sale: discount price is never hide

This commit is contained in:
Christophe Matthieu 2014-06-30 13:53:25 +02:00
parent ebd74cedcc
commit 162ee61d4f
4 changed files with 20 additions and 3 deletions

View File

@ -333,6 +333,14 @@ label.css_attribute_color.css_not_available {
max-height: 500px;
}
.oe_default_price {
display: none;
}
.discount .oe_default_price {
display: block;
}
/* ---- Publish managment and options ---- */
#products_grid .css_options {
display: none;

View File

@ -282,6 +282,11 @@ label.css_attribute_color.css_not_available
display: block
max-height: 500px
.oe_default_price
display: none
.discount .oe_default_price
display: block
/* ---- Publish managment and options ---- */
#products_grid .css_options

View File

@ -102,7 +102,11 @@ $('.oe_website_sale').each(function () {
if (_.isEqual(variant_ids[k][1], values)) {
$price.html(price_to_str(variant_ids[k][2]));
$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];
break;
}

View File

@ -371,7 +371,7 @@
</div>
</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) &gt; 0.1 and 'discount'}" id="product_detail">
<div class="row">
<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"}'/>
@ -435,7 +435,7 @@
<template id="product_price">
<div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
<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) &gt; 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-options='{
"widget": "monetary",