Merge branch 'adminbsb_material_ui'
This commit is contained in:
@@ -12,6 +12,16 @@ $(function() {
|
||||
|
||||
var menu_list = $('.menu_items_list');
|
||||
menu_list.empty();
|
||||
|
||||
if (type != -1 && modify_order != -1) {
|
||||
url_item = '../../../../../'+url_item;
|
||||
}
|
||||
if(modify_order == -1 && type != -1){
|
||||
url_item = '../../../../'+url_item;
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
url_item = url_item
|
||||
}
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
@@ -31,37 +41,47 @@ $(function() {
|
||||
item_attributes = [];
|
||||
|
||||
if (product[field].image_path) {
|
||||
image_path = product[field].image_path.url;
|
||||
if (type != -1 && modify_order != -1) {
|
||||
image_path = '../../'+product[field].image_path.url;
|
||||
}
|
||||
if(modify_order == -1 && type != -1){
|
||||
image_path = '../../../../'+product[field].image_path.url;
|
||||
}
|
||||
if (type ==-1 && modify_order == -1){
|
||||
image_path = product[field].image_path.url;
|
||||
}
|
||||
}else{
|
||||
image_path = "/image/logo.png";
|
||||
}
|
||||
|
||||
row = '<div class="card custom-card testimonial-card fadeInRight" style="">'
|
||||
row = '<div class="card custom-card testimonial-card 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;">'
|
||||
+'<div class="col-md-9">'+ product[field].name +'</div>'
|
||||
+"<div class='col-md-3 add_icon' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' data-attributes = '"
|
||||
+ JSON.stringify(item_attributes) +"' data-options = '"
|
||||
+ options +"' data-image='"+image_path+"'>"
|
||||
+"<div class='col-md-3 menu_item_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_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(item_attributes)+"' data-image='"+image_path+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<i class='fa fa-bars material-icons'>"
|
||||
+'view_list</i>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
|
||||
+"<div class='menu_item_box' data-item-code='"
|
||||
+ product[field].item_code +"' data-instance = '"
|
||||
+JSON.stringify(item_attributes)+"' data-id = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item = '"
|
||||
+JSON.stringify(item_attributes)+"' data-option = '"
|
||||
+JSON.stringify(item_attributes)+"' data-item-sets = '"
|
||||
+JSON.stringify(item_attributes)+"' data-toggle='modal' data-target='.sx_item_detailModal'>"
|
||||
+"<div class='add_icon' data-item-code='"
|
||||
+ product[field].item_code +"' data-name='"
|
||||
+ product[field].name +"' data-qty = '"+ qty +"' data-price = '"
|
||||
+ product[field].unit_price +"' data-instance-code = '"+ product[field].item_code +"' data-instance = '"
|
||||
+ product[field].name +"' data-promotion-price = '"+ 1 +"' 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+"'>"
|
||||
|
||||
+"<div class='card-block custom-card-block'>"
|
||||
+"<img id='logo' height='125px' src='"+image_path+"'>"
|
||||
+"</div>"
|
||||
// +"<div class='card-block custom-card-block'>"
|
||||
// +"<img id='logo' height='125px' src='"+image_path+"'>"
|
||||
// +"</div>"
|
||||
|
||||
+'<div class="card-footer custom-card-footer">'
|
||||
+'<span>'+ product[field].unit_price +'</span>'
|
||||
@@ -231,6 +251,7 @@ $(function() {
|
||||
$(document).on('click', '.set_item_box', function(event){
|
||||
$(".instance-list").empty();
|
||||
$(".options-list").empty();
|
||||
$(".selected-set-list").empty();
|
||||
$('.set_change_qty').val(1);
|
||||
change_qty_plus_minus("set_count","set_plus","set_minus");
|
||||
data = $(this).parent().children().children('.add_icon');
|
||||
@@ -353,7 +374,7 @@ $(function() {
|
||||
sub_total = $('#set_total_price').text();
|
||||
name = $(this).data('name');
|
||||
price = $(this).data('price');
|
||||
options = $(this).attr('data-options','');
|
||||
options = $(this).attr('data-options','[]');
|
||||
// qty = $('#set_change_qty').val();
|
||||
qty = document.getElementById("set_count").value;
|
||||
total = qty*price;
|
||||
@@ -364,7 +385,8 @@ $(function() {
|
||||
+"' data-name='"+$(this).data('name')
|
||||
+"' data-code='"+code
|
||||
+"' data-price='"+$(this).data('price')
|
||||
+"' data-option='"+JSON.stringify($(this).data('option'))
|
||||
+"' data-option='[]"
|
||||
+"' data-options='"+JSON.stringify($(this).data('options'))
|
||||
+"' data-min-qty='"+$(this).data('min-qty')
|
||||
+"' data-max-qty='"+$(this).data('max-qty')
|
||||
+"' data-parent-code='"+$(this).data('parent-code')
|
||||
@@ -387,7 +409,7 @@ $(function() {
|
||||
+'</div>'
|
||||
$(".selected-set-list").append(set);
|
||||
}else{
|
||||
swal("Alert !", 'Maximum Qty is ' + max_qty + " items", "warning");
|
||||
swal("Alert !", 'Maximum Select is ' + max_qty + " items", "warning");
|
||||
}
|
||||
// }
|
||||
$('#set_unit_price').text(price);
|
||||
@@ -419,8 +441,7 @@ $(function() {
|
||||
|
||||
default_instance = $('.set-item');
|
||||
|
||||
var items = $('.selected-instance');
|
||||
|
||||
var items = $('.selected-set');
|
||||
if (items.length >= min_qty) {
|
||||
|
||||
item = get_set_item(items);
|
||||
@@ -432,11 +453,10 @@ $(function() {
|
||||
code = $('.set-item').attr('data-code');
|
||||
name = $('.set-item').attr('data-name');
|
||||
price = $('.set-item').attr('data-price');
|
||||
option_name = ($('.set-item').attr('data-options') === 'undefined') ? '' :$('.set-item').attr('data-options');
|
||||
option_name = ($('.set-item').attr('data-options') === 'undefined') ? ' ' :$('.set-item').attr('data-options');
|
||||
option = ($('.set-item').attr('data-options') === '') ? '[]' :$('.set-item').attr('data-options');
|
||||
parent = $('.set-item').attr('data-parent');
|
||||
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='"
|
||||
@@ -454,13 +474,14 @@ $(function() {
|
||||
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');
|
||||
set_option_name = ($(items[i]).attr('data-options') === 'undefined') ? ' ' :$(items[i]).attr('data-options');
|
||||
set_option= ($(items[i]).attr('data-options') === '') ? '[]' :$(items[i]).attr('data-options');
|
||||
sub_item = $(items[i]).attr('data-sub-item');
|
||||
total = qty * price ;
|
||||
console.log($(items[0]).attr('data-name'))
|
||||
code = $(items[i]).attr('data-code');
|
||||
name = $(items[i]).attr('data-name');
|
||||
price = $(items[i]).attr('data-price');
|
||||
set_option_name = ($(items[i]).attr('data-options') === 'undefined') ? '' :$(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');
|
||||
total = qty * price ;
|
||||
|
||||
row ="<tr class='item_box' data-price ='"
|
||||
+price+ "' data-toggle='modal' data-target='#sx_itemModal' 'data-instance ='"
|
||||
@@ -711,6 +732,7 @@ $(function() {
|
||||
|
||||
attribute_arr = get_selected_attributes('selected-attribute');
|
||||
option_arr = get_selected_attributes('selected-option');
|
||||
console.log(option_arr)
|
||||
if (item_row.length>0) {
|
||||
var instances = jQuery.parseJSON(item_row.attr('data-instances'));
|
||||
|
||||
@@ -748,6 +770,7 @@ $(function() {
|
||||
$('.add_to_order').attr('data-name',$('#title_name').text());
|
||||
$('.add_to_order').attr('data-attributes',JSON.stringify(attribute_arr));
|
||||
$('.add_to_order').attr('data-options',JSON.stringify(option_arr));
|
||||
$('.add_to_order').attr('data-opt',JSON.stringify(option_arr));
|
||||
var item_data = $(this);
|
||||
item = get_item(item_data,"add_to_order");
|
||||
customer_display_view(item,"add");
|
||||
@@ -785,8 +808,7 @@ $(function() {
|
||||
option_name = ' ';
|
||||
data_option = '[]';
|
||||
}
|
||||
|
||||
|
||||
console.log(d_option)
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
var item_row = $('.summary-items tbody tr');
|
||||
|
||||
@@ -794,7 +816,8 @@ $(function() {
|
||||
item_code = $(item_row[i]).attr('data-code');
|
||||
instance_code = $(item_row[i]).attr('data-instance-code');
|
||||
r_option = $(item_row[i]).attr('data-opt');
|
||||
if (item_code == data.attr('data-item-code') && instance_code == data.attr('data-instance-code')&&r_option == d_option) {
|
||||
console.log(r_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{
|
||||
@@ -804,7 +827,7 @@ $(function() {
|
||||
$(item_row[i]).children('#item_qty').text(qty);
|
||||
parseFloat($(item_row[i]).children('#item_price').text(parseFloat(price*qty).toFixed(2)));
|
||||
append =1;
|
||||
}else{
|
||||
}else{
|
||||
if (qty > 1) {
|
||||
qty = qty;
|
||||
}else{
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
<p class="hidden" id="set_item_code"></p>
|
||||
<p></p>
|
||||
|
||||
<div class="" id="modal-slimscroll" data-height="250">
|
||||
<div class="" id="modal-slimscroll" data-height="100">
|
||||
<div class="options-list" style="margin-top:-5px">
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user