update option and menu export csv single
This commit is contained in:
@@ -180,7 +180,6 @@ $(function() {
|
||||
image_path = "image/logo.png";
|
||||
}
|
||||
}
|
||||
console.log(menu_items[field].options)
|
||||
|
||||
row = '<div class="card custom-card testimonial-card animated fadeInRight" style="height:100%;background-image:url(../../'+image_path+');background-repeat: no-repeat;">'
|
||||
+'<div class="custom-card-head card-head row" style="line-height:14px;margin:0px;" style="">'
|
||||
@@ -190,6 +189,7 @@ $(function() {
|
||||
+JSON.stringify(menu_items[field].instances)+"' data-id = '"
|
||||
+JSON.stringify(menu_items[field].attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(menu_items[field].options)+"'data-opt = '"
|
||||
+JSON.stringify(menu_items[field].options)+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"' data-toggle='modal' data-target='."+data_target+"' >"
|
||||
+"<i class='fa "+fa_plus+" '>"
|
||||
@@ -202,6 +202,7 @@ $(function() {
|
||||
+ price +"' data-instance-code = '"+ code +"' data-instance = '"
|
||||
+ name +"' data-promotion-price = '"+ promotion_price +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ JSON.stringify(menu_items[field].options) +"' data-opt = '"
|
||||
+ JSON.stringify(menu_items[field].options) +"' data-image='"+image_path+"' data-toggle='"
|
||||
+data_modal+"' data-target='."+data_target+"' data-item-sets = '"
|
||||
+JSON.stringify(menu_items[field].item_sets)+"'data-instances = '"
|
||||
@@ -296,7 +297,7 @@ $(function() {
|
||||
$('.set-item').attr('data-code',instances[0]['code']);
|
||||
$('.set-item').attr('data-name',instances[0]['name']);
|
||||
$('.set-item').attr('data-price',instances[0]['price']);
|
||||
// $('.set-item').attr('data-options','[]');
|
||||
$('.set-item').attr('data-options','');
|
||||
$('.set-item').attr('data-parent',true);
|
||||
|
||||
$('#set_change_qty').val(1);
|
||||
@@ -351,6 +352,7 @@ $(function() {
|
||||
sub_total = $('#set_total_price').text();
|
||||
name = $(this).data('name');
|
||||
price = $(this).data('price');
|
||||
options = $(this).attr('data-options','');
|
||||
// qty = $('#set_change_qty').val();
|
||||
qty = document.getElementById("set_count").value;
|
||||
total = qty*price;
|
||||
@@ -379,14 +381,14 @@ $(function() {
|
||||
|
||||
item = get_set_item(items);
|
||||
customer_display_view(item,"set_add");
|
||||
|
||||
var option = ''
|
||||
attribute_arr = []
|
||||
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
code = $('.set-item').attr('data-code');
|
||||
name = $('.set-item').attr('data-name');
|
||||
price = $('.set-item').attr('data-price');
|
||||
option = $('.set-item').attr('data-options');
|
||||
option = ($('.set-item').attr('data-options') === 'undefined') ? '' :$('.set-item').attr('data-options');
|
||||
parent = $('.set-item').attr('data-parent');
|
||||
total = qty * price ;
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
@@ -396,7 +398,7 @@ $(function() {
|
||||
+attribute_arr+"' data-options ='"
|
||||
+option+"' data-row ='"+rowCount+ "' data-parent ='"+parent+ "'>"
|
||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'-' + option +'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + option +'</td>'
|
||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||
+'<td class="item-cell-price" id="item_price">'
|
||||
+ parseFloat(total).toFixed(2)
|
||||
@@ -404,22 +406,23 @@ $(function() {
|
||||
+'</tr>';
|
||||
$(".summary-items tbody").append(row);
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
var set_option = ''
|
||||
$(items).each(function(i){
|
||||
code = $(items[i]).attr('data-code');
|
||||
name = $(items[i]).attr('data-name');
|
||||
price = $(items[i]).attr('data-price');
|
||||
option = $(items[i]).attr('data-options');
|
||||
set_option = ($(items[i]).attr('data-options') === 'undefined') ? ' ' :$(items[i]).attr('data-options');
|
||||
|
||||
sub_item = $(items[i]).attr('data-sub-item');
|
||||
option = $(items[i]).attr('data-options');
|
||||
total = qty * price ;
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
+name+ "' data-code='"+item_code+"' data-instance-code='"
|
||||
+code+"' data-attributes='"
|
||||
+attribute_arr+"' data-options ='"
|
||||
+option+"' data-row ='"+rowCount+ "' data-sub-item ='"+sub_item+ "'>"
|
||||
+set_option+"' data-row ='"+rowCount+ "' data-sub-item ='"+sub_item+ "'>"
|
||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +'-' + option +'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + item_name+ ' ' + name +' ' + set_option +'</td>'
|
||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||
+'<td class="item-cell-price" id="item_price">'
|
||||
+ parseFloat(total).toFixed(2)
|
||||
@@ -659,7 +662,6 @@ $(function() {
|
||||
|
||||
attribute_arr = get_selected_attributes('selected-attribute');
|
||||
option_arr = get_selected_attributes('selected-option');
|
||||
|
||||
if (item_row.length>0) {
|
||||
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
||||
|
||||
@@ -700,7 +702,7 @@ $(function() {
|
||||
var item_data = $(this);
|
||||
item = get_item(item_data);
|
||||
customer_display_view(item,"add");
|
||||
show_item_detail(item_data);
|
||||
show_item_detail(item_data,"add_to_order");
|
||||
calculate_sub_total();
|
||||
|
||||
}); //End add order Click
|
||||
@@ -710,11 +712,11 @@ $(function() {
|
||||
var item_data = $(this);
|
||||
item = get_item(item_data);
|
||||
customer_display_view(item,"add");
|
||||
show_item_detail(item_data);
|
||||
show_item_detail(item_data,"add_icon");
|
||||
calculate_sub_total();
|
||||
}); //End Add Icon Click
|
||||
|
||||
function show_item_detail(data){
|
||||
function show_item_detail(data,click_type){
|
||||
|
||||
qty = parseInt(data.attr('data-qty'));
|
||||
append = 0;
|
||||
@@ -726,23 +728,26 @@ $(function() {
|
||||
}else{
|
||||
instance = "("+data.attr('data-instance')+")";
|
||||
}
|
||||
|
||||
d_option = data.attr('data-options');
|
||||
if (d_option){
|
||||
option_name = "-"+data.attr('data-options');
|
||||
d_option = data.attr('data-opt');
|
||||
if (click_type != "add_icon"){
|
||||
option_name = "-"+data.attr('data-options');
|
||||
data_option = data.attr('data-options') ;
|
||||
}else{
|
||||
option_name = '';
|
||||
option_name = ' ';
|
||||
data_option = '[]';
|
||||
}
|
||||
|
||||
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
var item_row = $('.summary-items tbody tr');
|
||||
|
||||
$(item_row).each(function(i){
|
||||
item_code = $(item_row[i]).attr('data-code');
|
||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||
r_option = $(item_row[i]).attr('data-options');
|
||||
|
||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option==d_option) {
|
||||
r_option = $(item_row[i]).attr('data-opt');
|
||||
console.log(r_option)
|
||||
console.log(d_option)
|
||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||
if (qty > 1) {
|
||||
qty = parseInt($(item_row[i]).children('#item_qty').text()) + qty;
|
||||
}else{
|
||||
@@ -766,9 +771,10 @@ $(function() {
|
||||
+instance+ "' data-code='"+data.attr('data-item-code')+"' data-instance-code='"
|
||||
+data.attr('data-instance-code')+"' data-attributes='"
|
||||
+data.attr('data-attributes')+"' data-options ='"
|
||||
+data_option+"' data-opt ='"
|
||||
+data.attr('data-options')+"' data-row ='"+rowCount+ "'>"
|
||||
+'<td class="item-cell-no">'+rowCount+'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +' ' + option_name +'</td>'
|
||||
+'<td class="item-cell-name" id="item_name" >' + data.attr('data-name')+ ' ' + instance +''+option_name+'</td>'
|
||||
+'<td class="item-cell-qty" id="item_qty">' + qty + '</td>'
|
||||
+'<td class="item-cell-price" id="item_price">'
|
||||
+ parseFloat(price).toFixed(2)
|
||||
@@ -822,8 +828,6 @@ $(function() {
|
||||
data: params,
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
console.log(type)
|
||||
console.log(table_type)
|
||||
if (type == "quick_service") {
|
||||
window.location.href = "/origami/quick_service"
|
||||
}else{
|
||||
@@ -889,7 +893,7 @@ $(function() {
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
if (result.status) {
|
||||
console.log(result)
|
||||
|
||||
if (result.data == null){
|
||||
swal({
|
||||
title: "Please Open Shift !",
|
||||
|
||||
Reference in New Issue
Block a user