[-] FO : #PSCFV-2840 - Fix bug with typewatch on the opc (qty change) and multishipping
This commit is contained in:
@@ -32,7 +32,7 @@ $(document).ready(function()
|
|||||||
$('.cart_quantity_up').unbind('click').live('click', function(){ upQuantity($(this).attr('id').replace('cart_quantity_up_', '')); return false; });
|
$('.cart_quantity_up').unbind('click').live('click', function(){ upQuantity($(this).attr('id').replace('cart_quantity_up_', '')); return false; });
|
||||||
$('.cart_quantity_down').unbind('click').live('click', function(){ downQuantity($(this).attr('id').replace('cart_quantity_down_', '')); return false; });
|
$('.cart_quantity_down').unbind('click').live('click', function(){ downQuantity($(this).attr('id').replace('cart_quantity_down_', '')); return false; });
|
||||||
$('.cart_quantity_delete' ).unbind('click').live('click', function(){ deleteProductFromSummary($(this).attr('id')); return false; });
|
$('.cart_quantity_delete' ).unbind('click').live('click', function(){ deleteProductFromSummary($(this).attr('id')); return false; });
|
||||||
$('.cart_quantity_input').typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: updateQty });
|
$('.cart_quantity_input').typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: function(val) { updateQty(val, true, this.el) } });
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.cart_address_delivery').live('change', function(){ changeAddressDelivery($(this)); });
|
$('.cart_address_delivery').live('change', function(){ changeAddressDelivery($(this)); });
|
||||||
@@ -224,15 +224,20 @@ function updateAddressId(id_product, id_product_attribute, old_id_address_delive
|
|||||||
.attr('id', 'select_address_delivery_' + id_product+'_' + id_product_attribute + '_' + id_address_delivery);
|
.attr('id', 'select_address_delivery_' + id_product+'_' + id_product_attribute + '_' + id_address_delivery);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateQty(val)
|
function updateQty(val, cart, el)
|
||||||
{
|
{
|
||||||
var id = $(this.el).attr('name');
|
if (typeof(cart) == 'undefined' || cart)
|
||||||
|
var prefix = '#order-detail-content ';
|
||||||
|
else
|
||||||
|
var prefix = '#fancybox-content ';
|
||||||
|
|
||||||
|
var id = $(el).attr('name');
|
||||||
var exp = new RegExp("^[0-9]+$");
|
var exp = new RegExp("^[0-9]+$");
|
||||||
|
|
||||||
if (exp.test(val) == true)
|
if (exp.test(val) == true)
|
||||||
{
|
{
|
||||||
var hidden = $('input[name='+ id +'_hidden]').val();
|
var hidden = $(prefix+'input[name='+ id +'_hidden]').val();
|
||||||
var input = $('input[name='+ id +']').val();
|
var input = $(prefix+'input[name='+ id +']').val();
|
||||||
var QtyToUp = parseInt(input) - parseInt(hidden);
|
var QtyToUp = parseInt(input) - parseInt(hidden);
|
||||||
|
|
||||||
if (parseInt(QtyToUp) > 0)
|
if (parseInt(QtyToUp) > 0)
|
||||||
@@ -241,7 +246,7 @@ function updateQty(val)
|
|||||||
downQuantity(id.replace('quantity_', ''), QtyToUp);
|
downQuantity(id.replace('quantity_', ''), QtyToUp);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$('input[name='+ id +']').val($('input[name='+ id +'_hidden]').val());
|
$(prefix+'input[name='+ id +']').val($(prefix+'input[name='+ id +'_hidden]').val());
|
||||||
|
|
||||||
if (typeof(getCarrierListAndUpdate) != 'undefined')
|
if (typeof(getCarrierListAndUpdate) != 'undefined')
|
||||||
getCarrierListAndUpdate();
|
getCarrierListAndUpdate();
|
||||||
|
|||||||
@@ -742,6 +742,7 @@ function multishippingMode(it)
|
|||||||
cache: false,
|
cache: false,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
$('#cart_summary').replaceWith($(data).find('#cart_summary'));
|
$('#cart_summary').replaceWith($(data).find('#cart_summary'));
|
||||||
|
$('.cart_quantity_input').typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: function(val) { updateQty(val, true, this.el) } });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
updateCarrierSelectionAndGift();
|
updateCarrierSelectionAndGift();
|
||||||
@@ -756,6 +757,7 @@ function multishippingMode(it)
|
|||||||
},
|
},
|
||||||
'onComplete': function()
|
'onComplete': function()
|
||||||
{
|
{
|
||||||
|
$('#fancybox-content .cart_quantity_input').typeWatch({ highlight: true, wait: 600, captureLength: 0, callback: function(val) { updateQty(val, false, this.el)} });
|
||||||
cleanSelectAddressDelivery();
|
cleanSelectAddressDelivery();
|
||||||
$('#fancybox-content').append($('<div class="multishipping_close_container"><a id="multishipping-close" class="button_large" href="#">' + CloseTxt + '</a></div>'));
|
$('#fancybox-content').append($('<div class="multishipping_close_container"><a id="multishipping-close" class="button_large" href="#">' + CloseTxt + '</a></div>'));
|
||||||
$('#multishipping-close').click(function() {
|
$('#multishipping-close').click(function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user