update addorder
This commit is contained in:
@@ -110,6 +110,9 @@ $(function(){
|
||||
item_sets = $(this).data('item-sets');
|
||||
|
||||
for(var field in item_sets) {
|
||||
|
||||
$('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]);
|
||||
|
||||
value = item_sets[field]["instances"];
|
||||
$(value).each(function(i){
|
||||
console.log(value);
|
||||
@@ -161,12 +164,15 @@ $(function(){
|
||||
|
||||
$(".options-list").empty();
|
||||
|
||||
rowCount = $('.selected-instance');
|
||||
item_options = $(this).data('option');
|
||||
|
||||
min_qty = $(this).data('min-qty');
|
||||
max_qty = $(this).data('max-qty');
|
||||
|
||||
code = $(this).data('code');
|
||||
|
||||
if ($('.selected-instance').length+1 <= max_qty) {
|
||||
if (rowCount.length+1 <= max_qty) {
|
||||
for(var field in item_options) {
|
||||
value = item_options[field]["values"];
|
||||
type = item_options[field]["type"];
|
||||
@@ -192,7 +198,7 @@ $(function(){
|
||||
$(this).removeAttr('data-options');
|
||||
$('#instance_option').text('')
|
||||
}else {
|
||||
if ($('.selected-instance').length+1 <= max_qty) {
|
||||
if (rowCount.length+1 <= max_qty) {
|
||||
sub_total = $('#set_total_price').text();
|
||||
name = $(this).data('name');
|
||||
price = $(this).data('price');
|
||||
@@ -214,9 +220,11 @@ $(function(){
|
||||
qty = parseInt($('#set_count').val());
|
||||
item_code = $('#set_item_code').text();
|
||||
item_name = $('#set_name').text();
|
||||
min_qty = $(this).data('min-qty');
|
||||
|
||||
var items = $('.selected-instance');
|
||||
|
||||
if (items.length >= min_qty) {
|
||||
attribute_arr = []
|
||||
option_arr = []
|
||||
var rowCount = $('.summary-items tbody tr').length+1;
|
||||
@@ -244,6 +252,17 @@ $(function(){
|
||||
rowCount = rowCount + 1;
|
||||
});
|
||||
calculate_sub_total();
|
||||
$(".sx_item_set_detailModal").css({ 'display': "none" });
|
||||
}else{
|
||||
$(".sx_item_set_detailModal").css({ 'display': "block" });
|
||||
$.alert({
|
||||
title: 'Alert!',
|
||||
content: 'Please Select Minimum ' + min_qty + " items",
|
||||
type: 'red',
|
||||
typeAnimated: true,
|
||||
btnClass: 'btn-danger',
|
||||
});
|
||||
}
|
||||
|
||||
}); //End add order Click
|
||||
|
||||
|
||||
Reference in New Issue
Block a user