add out of stock
This commit is contained in:
@@ -1483,7 +1483,8 @@ $(function() {
|
||||
instances = menu_items[field].instances;
|
||||
$(instances).each(function(i){
|
||||
if (instances[i].is_default == true) {
|
||||
price = parseFloat(instances[i].price).toFixed(2);
|
||||
price = parseFloat(instances[i].price).toFixed(2);
|
||||
out_of_stock = instances[i].out_of_stock;
|
||||
}else{
|
||||
price = 0;
|
||||
}
|
||||
@@ -1510,18 +1511,28 @@ $(function() {
|
||||
item_attributes = instances[i].values;
|
||||
promotion_price = instances[i].promotion_price;
|
||||
code = instances[i].code;
|
||||
out_of_stock = instances[i].out_of_stock;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (menu_items[field].image) {
|
||||
if (modify_order) {
|
||||
image_path = "../../"+menu_items[field].image;
|
||||
}else{
|
||||
image_path = menu_items[field].image;
|
||||
}
|
||||
if (out_of_stock === true) {
|
||||
// oos_item = out_of_stock_item
|
||||
oos_item = '<div class="card custom-card testimonial-card fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;pointer-events: none;opacity: 0.4;">'
|
||||
oos_header = '<div style="position: absolute;z-index: 5;top: 0;left: 0;right: 0;text-align: center;background: #fb483a;margin: auto;color: #fff;padding: 8px;font-weight: bolder;">OUT OF STOCK</div>'
|
||||
}else{
|
||||
oos_item = '<div class="card custom-card testimonial-card fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||
oos_header = ''
|
||||
}
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3">'
|
||||
+'<div class="card custom-card testimonial-card fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||
+ oos_item + oos_header
|
||||
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;" >'
|
||||
+'<div class="col-md-10 " style="padding:0px !important;">'+ menu_items[field].name +'</div>'
|
||||
|
||||
@@ -1564,8 +1575,16 @@ $(function() {
|
||||
+'</div>'
|
||||
+'</div>'; ;
|
||||
}else{
|
||||
if (out_of_stock === true) {
|
||||
// oos_item = out_of_stock_item
|
||||
oos_item = '<div class="card custom-card testimonial-card fadeInRight" style="height:100%; pointer-events: none;opacity: 0.4;">'
|
||||
oos_header = '<div style="position: absolute;z-index: 5;top: 0;left: 0;right: 0;text-align: center;background: #fb483a;margin: auto;color: #fff;padding: 8px;font-weight: bolder;">OUT OF STOCK</div>'
|
||||
}else{
|
||||
oos_item = '<div class="card custom-card testimonial-card fadeInRight" style="height:100%;">'
|
||||
oos_header = ''
|
||||
}
|
||||
row = '<div class="col-md-6 col-sm-6 col-lg-3 mt-1">'
|
||||
+'<div class="card custom-card testimonial-card fadeInRight" style="height:100%;">'
|
||||
+ oos_item + oos_header
|
||||
+'<div class="custom-card-no-img-head card-head '+add_icon+' " style="margin:0px;display:flex;!important "'
|
||||
+" data-item-code='"+ menu_items[field].code +"' "
|
||||
+" data-name='" + menu_items[field].name +"' "
|
||||
@@ -1621,6 +1640,7 @@ $(function() {
|
||||
|
||||
+'</div>'
|
||||
+'</div>';
|
||||
|
||||
}
|
||||
|
||||
$('.menu_items_list').append(row);
|
||||
|
||||
Reference in New Issue
Block a user