[IMP] website_sale: display 'Product not available' message in product selector

This commit is contained in:
Christophe Matthieu 2014-06-13 09:32:28 +02:00
parent 9d363b8758
commit 8a24171996
4 changed files with 49 additions and 15 deletions

View File

@ -298,13 +298,32 @@
margin: 6px;
}
.js_add_cart_variants option.css_not_available {
.css_not_available_msg {
display: none;
}
.css_not_available .row > div:nth-child(3), .css_not_available .row > div:nth-child(4) {
display: none;
}
.css_not_available .row > div:last-child {
display: block;
}
.css_not_available .product_price {
display: none;
}
.css_not_available .css_not_available_msg {
display: block;
}
option.css_not_available {
color: #cccccc;
}
.js_add_cart_variants label.css_not_available {
label.css_not_available {
opacity: 0.6;
}
.js_add_cart_variants label.css_attribute_color.css_not_available {
label.css_attribute_color.css_not_available {
opacity: 1;
background-image: url("/website_sale/static/src/img/redcross.png");
background-size: cover;

View File

@ -257,15 +257,27 @@
&.active input
margin: 6px
.js_add_cart_variants
option.css_not_available
color: #ccc
label.css_not_available
opacity: 0.6
label.css_attribute_color.css_not_available
opacity: 1
background-image: url('/website_sale/static/src/img/redcross.png')
background-size: cover
.css_not_available_msg
display: none
.css_not_available
.row
> div:nth-child(3), > div:nth-child(4)
display: none
> div:last-child
display: block
.product_price
display: none
.css_not_available_msg
display: block
option.css_not_available
color: #ccc
label.css_not_available
opacity: 0.6
label.css_attribute_color.css_not_available
opacity: 1
background-image: url('/website_sale/static/src/img/redcross.png')
background-size: cover
.product_detail_img
margin-left: auto

View File

@ -110,11 +110,11 @@ $(document).ready(function () {
});
if (product_id) {
$parent.removeClass("oe_not_available");
$parent.removeClass("css_not_available");
$porduct_id.val(product_id);
$parent.find(".js_check_product").removeAttr("disabled");
} else {
$parent.addClass("oe_not_available");
$parent.addClass("css_not_available");
$porduct_id.val(0);
$parent.find(".js_check_product").attr("disabled", "disabled");
}

View File

@ -518,6 +518,9 @@
</span>
</div>
</div>
<div class="col-xs-4">
<p class="css_not_available_msg bg-danger" style="padding: 15px;">Product not available</p>
</div>
</div>
</div>
@ -568,7 +571,7 @@
<t t-call="website_sale.product_price"/>
<p class="hidden oe_not_available bg-danger" style="padding: 15px;">Product not available</p>
<p class="css_not_available_msg bg-danger" style="padding: 15px;">Product not available</p>
<a t-if="not optional_product_ids" class="btn btn-primary btn-lg mt8 a-submit js_check_product">Add to Cart</a>
<a t-if="optional_product_ids" class="btn btn-primary btn-lg mt8 js_check_product" href="#" data-toggle="modal" data-target="#modal_optional_products">Add to Cart</a>