diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index e49f7446..30ed8af2 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -266,11 +266,22 @@ $(function() { $('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]); value = item_sets[field]["instances"]; - $(value).each(function(i){ + if (type != -1 && modify_order != -1) { + url = '../../../../api/restaurant/menu_item_instances/'+value[i]["id"]; + console.log("ssssssss") + } + if(modify_order == -1 && type != -1){ + url = '../../api/restaurant/menu_item_instances/'+value[i]["id"] ; + console.log("aaaaaa") + } + if (type ==-1 && modify_order == -1){ + url = '../../api/restaurant/menu_item_instances/'+value[i]["id"]; + console.log("cccccccccc") + } $.ajax({ type: "GET", - url: '../../api/restaurant/menu_item_instances/'+value[i]["id"], + url: url, data: {id:value[i]}, success:function(result){ @@ -370,7 +381,7 @@ $(function() { // $(this).removeAttr('data-options'); // $('#instance_option').text('') // }else { - if (rowCount.length+1 <= max_qty) { + if (setCount.length+1 <= max_qty) { sub_total = $('#set_total_price').text(); name = $(this).data('name'); price = $(this).data('price'); @@ -1317,9 +1328,18 @@ console.log(d_option) } function customer_display_view(data,status) { + if (type != -1 && modify_order != -1) { + url = '../../../../origami/customer_view'; + } + if(modify_order == -1 && type != -1){ + url = '../../origami/customer_view'; + } + if (type ==-1 && modify_order == -1){ + url = '../../origami/customer_view'; + } $.ajax({ type: "POST", - url: '../../origami/customer_view', + url: url, data: {"data":data,"status":status}, dataType: "json", success:function(result){