Testingshopping/prestashop/themes/default-bootstrap/js/product.js
// Change the current product images regarding the combination selected
Change the current product images regarding the combination selected
Change the current product images regarding the combination selected
function refreshProductImages(id_product_attribute)
{
	id_product_attribute = parseInt(id_product_attribute);
	if (id_product_attribute > 0 && typeof(combinationImages) !== 'undefined' && typeof(combinationImages[id_product_attribute]) !== 'undefined')
	{
		$('#thumbs_list li').hide();
		for (var i = 0; i < combinationImages[id_product_attribute].length; i++)
			if (typeof(jqZoomEnabled) !== 'undefined' && jqZoomEnabled)
				$('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show().children('a.shown').trigger('click');
			else
				$('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show();
	}
	else
	{
		$('#thumbs_list li').show();
		var choice = [];
		var radio_inputs = parseInt($('#attributes .checked > input[type=radio]').length);
		if (radio_inputs)
			radio_inputs = '#attributes .checked > input[type=radio]';
		else
			radio_inputs = '#attributes input[type=radio]:checked';
		$('#attributes select, #attributes input[type=hidden], ' + radio_inputs).each(function(){
			choice.push(parseInt($(this).val()));
		});
		if (typeof combinationsHashSet !== 'undefined') {
			var combination = combinationsHashSet[choice.sort().join('-')];
			if(combination) {
				if (combination['image'] && combination['image'] != -1)
					displayImage($('#thumb_' + combination['image']).parent());
			}
		}
	}
	if (parseInt($('#thumbs_list_frame >li:visible').length) != parseInt($('#thumbs_list_frame >li').length))
		$('#wrapResetImages').stop(true, true).show();
	else
		$('#wrapResetImages').stop(true, true).hide();
	$('#thumbs_list_frame').width(parseInt($('#thumbs_list_frame >li').outerWidth(true) * $('#thumbs_list_frame >li').length) + 'px');
	$('#thumbs_list').trigger('goto', 0);
	serialScrollFixLock('', '', '', '', 0);
}
function refreshProductImages ( id_product_attribute ) { id_product_attribute = parseInt ( id_product_attribute ) ; if ( id_product_attribute > 0 && typeof ( combinationImages ) !== 'undefined' && typeof ( combinationImages [ id_product_attribute ] ) !== 'undefined' ) { $ ( '#thumbs_list li' ) . hide ( ) ; for ( var i = 0 ; i < combinationImages [ id_product_attribute ] . length ; i ++ ) if ( typeof ( jqZoomEnabled ) !== 'undefined' && jqZoomEnabled ) $ ( '#thumbnail_' + parseInt ( combinationImages [ id_product_attribute ] [ i ] ) ) . show ( ) . children ( 'a.shown' ) . trigger ( 'click' ) ; else $ ( '#thumbnail_' + parseInt ( combinationImages [ id_product_attribute ] [ i ] ) ) . show ( ) ; } else { $ ( '#thumbs_list li' ) . show ( ) ; var choice = [ ] ; var radio_inputs = parseInt ( $ ( '#attributes .checked > input[type=radio]' ) . length ) ; if ( radio_inputs ) radio_inputs = '#attributes .checked > input[type=radio]' ; else radio_inputs = '#attributes input[type=radio]:checked' ; $ ( '#attributes select, #attributes input[type=hidden], ' + radio_inputs ) . each ( function ( ) { choice . push ( parseInt ( $ ( this ) . val ( ) ) ) ; } ) ; if ( typeof combinationsHashSet !== 'undefined' ) { var combination = combinationsHashSet [ choice . sort ( ) . join ( '-' ) ] ; if ( combination ) { if ( combination [ 'image' ] && combination [ 'image' ] != - 1 ) displayImage ( $ ( '#thumb_' + combination [ 'image' ] ) . parent ( ) ) ; } } } if ( parseInt ( $ ( '#thumbs_list_frame >li:visible' ) . length ) != parseInt ( $ ( '#thumbs_list_frame >li' ) . length ) ) $ ( '#wrapResetImages' ) . stop ( true , true ) . show ( ) ; else $ ( '#wrapResetImages' ) . stop ( true , true ) . hide ( ) ; $ ( '#thumbs_list_frame' ) . width ( parseInt ( $ ( '#thumbs_list_frame >li' ) . outerWidth ( true ) * $ ( '#thumbs_list_frame >li' ) . length ) + 'px' ) ; $ ( '#thumbs_list' ) . trigger ( 'goto' , 0 ) ; serialScrollFixLock ( '' , '' , '' , '' , 0 ) ; }
Change the current product images regarding the combination selected
Change the current product images regarding the combination selected
//show the large image in relation to the selected combination