Testingshopping/prestashop/themes/default-bootstrap/js/product.js
//find a specific price rule, based on pre calculated dom display array
find a specific price rule, based on pre calculated dom display array
find a specific price rule based on pre calculated dom display array
function findSpecificPrice(){
	var domData = $("#quantityDiscount table tbody tr").not( ":hidden" );
	var nbProduct = $('#quantity_wanted').val();
	var newPrice = false;
	domData.each(function(i){
		var dataDiscountQuantity = parseInt($(this).attr('data-discount-quantity'));
		var dataDiscountNextQuantity = -1;
		var nextQtDiscount = $(domData[i+1]);
		if(nextQtDiscount.length){
			dataDiscountNextQuantity = parseInt(nextQtDiscount.attr('data-discount-quantity'));
		}
		if(
			(dataDiscountNextQuantity != -1 && nbProduct >= dataDiscountQuantity && nbProduct < dataDiscountNextQuantity) ||
			(dataDiscountNextQuantity == -1 && nbProduct >= dataDiscountQuantity)
		){
			newPrice = $(this).attr('data-real-discount-value');
			return false;
		}
	});
	return newPrice;
}
function findSpecificPrice ( ) { var domData = $ ( "#quantityDiscount table tbody tr" ) . not ( ":hidden" ) ; var nbProduct = $ ( '#quantity_wanted' ) . val ( ) ; var newPrice = false ; domData . each ( function ( i ) { var dataDiscountQuantity = parseInt ( $ ( this ) . attr ( 'data-discount-quantity' ) ) ; var dataDiscountNextQuantity = - 1 ; var nextQtDiscount = $ ( domData [ i + 1 ] ) ; if ( nextQtDiscount . length ) { dataDiscountNextQuantity = parseInt ( nextQtDiscount . attr ( 'data-discount-quantity' ) ) ; } if ( ( dataDiscountNextQuantity != - 1 && nbProduct >= dataDiscountQuantity && nbProduct < dataDiscountNextQuantity ) || ( dataDiscountNextQuantity == - 1 && nbProduct >= dataDiscountQuantity ) ) { newPrice = $ ( this ) . attr ( 'data-real-discount-value' ) ; return false ; } } ) ; return newPrice ; }
find a specific price rule, based on pre calculated dom display array
find a specific price rule based on pre calculated dom display array
//construct current specific price for current combination