update addorder and mem_action for additional para

This commit is contained in:
Aung Myo
2017-11-23 11:50:19 +06:30
parent fcb3c63b2f
commit 69dccb6770
5 changed files with 28 additions and 23 deletions

View File

@@ -886,27 +886,33 @@ $(function() {
$('.keypress_qty').keyup(function(e){
id = $(this).attr('id');
id = $(this).attr('id');
value = $(this).val();
$('.change_qty').attr('value',value);
if (id=="count") {
price = $("#unit_price").text();
$("#total_price").text(value*price);
}else{
var item_row = $('.selected-instance');
price = $("#set_unit_price").text();
set_total_price = $("#set_total_price").text();
$(".set_change_qty").val(value);
if (item_row.length > 1) {
total = 0 ;
$(item_row).each(function(i){
total += value * $(item_row[i]).attr('data-price');
total_price = total;
});
if ($.isNumeric(value)) {
$('.change_qty').attr('value',value);
if (id=="count") {
price = $("#unit_price").text();
$("#total_price").text(value*price);
}else{
total_price = value*price;
var item_row = $('.selected-instance');
price = $("#set_unit_price").text();
set_total_price = $("#set_total_price").text();
$(".set_change_qty").val(value);
if (item_row.length > 1) {
total = 0 ;
$(item_row).each(function(i){
total += value * $(item_row[i]).attr('data-price');
total_price = total;
});
}else{
total_price = value*price;
}
$("#set_total_price").text(total_price);
}
$("#set_total_price").text(total_price);
}else{
$('#'+id).val(1);
swal("Opps","Please enter number for qty","warning");
}
});