update addorder
This commit is contained in:
@@ -23,23 +23,11 @@ $(function(){
|
||||
var menu_items_list = $('.menu_items_list');
|
||||
menu_items_list.empty();
|
||||
menu_items = data.menu_items;
|
||||
console.log(url_item);
|
||||
|
||||
|
||||
for(var field in menu_items) {
|
||||
if (menu_items[field].is_sub_item == false) {
|
||||
instances = menu_items[field].instances ;
|
||||
$(instances).each(function(i){
|
||||
if (instances[i].is_default === true) {
|
||||
code = instances[i].code;
|
||||
name = instances[i].name;
|
||||
price = parseFloat(instances[i].price).toFixed(2);
|
||||
is_available = instances[i].is_available ;
|
||||
is_on_promotion = instances[i].is_on_promotion;
|
||||
item_attributes = instances[i].values;
|
||||
promotion_price = instances[i].promotion_price;
|
||||
code = instances[i].code;
|
||||
}
|
||||
});
|
||||
|
||||
qty = 1;
|
||||
options = [];
|
||||
|
||||
@@ -47,10 +35,32 @@ $(function(){
|
||||
fa_plus = '';
|
||||
menu_item_box = 'set_item_box';
|
||||
data_target = 'sx_item_set_detailModal';
|
||||
|
||||
code = menu_items[field].code;
|
||||
name = menu_items[field].name;
|
||||
price = 0;//parseFloat( menu_items[field].price).toFixed(2);
|
||||
is_available = menu_items[field].is_available ;
|
||||
is_on_promotion = 0;
|
||||
item_attributes = menu_items[field].attributes;
|
||||
promotion_price = menu_items[field].promotion_price;
|
||||
}else{
|
||||
fa_plus = 'fa-plus';
|
||||
menu_item_box = 'menu_item_box';
|
||||
data_target = 'sx_item_detailModal'
|
||||
data_target = 'sx_item_detailModal';
|
||||
|
||||
$(instances).each(function(i){
|
||||
if (instances[i].is_default === true) {
|
||||
code = instances[i].code;
|
||||
name = instances[i].name;
|
||||
price = parseFloat(instances[i].price).toFixed(2);
|
||||
is_available = instances[i].is_available ;
|
||||
is_on_promotion = instances[i].is_on_promotion;
|
||||
item_attributes = instances[i].values;
|
||||
promotion_price = instances[i].promotion_price;
|
||||
code = instances[i].code;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if (menu_items[field].image) {
|
||||
@@ -115,7 +125,6 @@ $(function(){
|
||||
|
||||
value = item_sets[field]["instances"];
|
||||
$(value).each(function(i){
|
||||
console.log(value);
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: '../../api/restaurant/menu_item_instances/'+value[i]["id"],
|
||||
@@ -625,6 +634,9 @@ $(function(){
|
||||
$(".item_box").removeAttr("data-active");
|
||||
});
|
||||
|
||||
$('#sx_item_set_detailModal').on('click','#close', function(){
|
||||
$("#sx_item_set_detailModal").css({ 'display': "none" });
|
||||
});
|
||||
//click save buttom after change qty
|
||||
$('#sx_itemModal').on('click','#save', function(){
|
||||
summary_items_filter();
|
||||
|
||||
@@ -36,6 +36,7 @@ class Origami::AddordersController < BaseOrigamiController
|
||||
if (params[:id])
|
||||
#Pull this menu
|
||||
@menu = MenuCategory.find_by_id(params[:id])
|
||||
puts @menu.menu_items[1].item_attributes.to_json
|
||||
return @menu
|
||||
else
|
||||
MenuCategory.current_menu
|
||||
|
||||
@@ -125,7 +125,8 @@ class Settings::SetMenuItemsController < ApplicationController
|
||||
end
|
||||
|
||||
def set_settings_item_attribute
|
||||
@item_attributes = MenuItemAttribute.all.order("id asc").map{|a| [a.name, a.value]}
|
||||
@item_attributes = MenuItemAttribute.all.order("id asc")#.map{|a| [a.name, a.value]}
|
||||
|
||||
end
|
||||
|
||||
def set_settings_item_option
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<div class="modal-dialog custom-modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||
<h4 class="modal-title"></h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -97,12 +97,12 @@
|
||||
|
||||
<!-- Menu Item modal -->
|
||||
|
||||
<div class="item-modal modal sx_item_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="item-modal modal sx_item_detailModal" id="sx_item_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog custom-modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="background-color: #54A5AF;">
|
||||
<h4 class="modal-title" style="color:#fff;" id="title_name"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@@ -159,12 +159,12 @@
|
||||
|
||||
|
||||
<!-- Large modal -->
|
||||
<div class=" modal sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" >
|
||||
<div class=" modal sx_item_set_detailModal" id="sx_item_set_detailModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" >
|
||||
<div class="modal-dialog custom-modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="background-color: #54A5AF;">
|
||||
<h4 class="modal-title" style="color:#fff;" id="set_name"></h4>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#fff;">×</button>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
Reference in New Issue
Block a user