Jump to content

Use of attributes without changing pictures


NookyBookyIV

Recommended Posts

Hi,

on my shop, I have some products with different attributes, but I didn't associate different pictures for each attribute. 

 

When I change the attribute of a product in the product page (client side), Prestashop changes the pictures shown on the left  to show the pictures of the attribute selected, but as I didn't associate pictures for each attribute, only the main picture of the product is still shown.

 

I have to click on "Show all images" to see all the pictures of the product again.

 

My question is : Can I use attributes in my shop but keep ALL the pictures of the product when someone change the attribute in the product page ?

 

I know it must be possible to do that with the "product.tpl", but I did a lot of tests without result.

 

Thanks !

Edited by NookyBookyIV (see edit history)
Link to comment
Share on other sites

 
However, I found the paragraph concerning the management of thumbnails in "product.js". I think I can solve my problem by generating all the product thumbnails, regardless of the chosen attribute.
 
I don't find the var which would allow me to generate all the pictures of the product, so if someone already did this modification, I would be glad to hear about it.

 

 

product.js

// Change the current product images regarding the combination selected
function refreshProductImages(id_product_attribute)
{	
	$('#thumbs_list_frame').scrollTo('li:eq(0)', 700, {axis:'x'});
	$('#thumbs_list li').hide();
	id_product_attribute = parseInt(id_product_attribute);

	if (typeof(combinationImages) != 'undefined' && typeof(combinationImages[id_product_attribute]) != 'undefined')
	{
		for (var i = 0; i < combinationImages[id_product_attribute].length; i++)
			$('#thumbnail_' + parseInt(combinationImages[id_product_attribute][i])).show();
	}
	if (i > 0)
	{
		var thumb_width = $('#thumbs_list_frame >li').width()+parseInt($('#thumbs_list_frame >li').css('marginRight'));
		$('#thumbs_list_frame').width((parseInt((thumb_width)* i) + 3) + 'px'); //  Bug IE6, needs 3 pixels more ?
	}
	else
	{
		$('#thumbnail_' + idDefaultImage).show();
		displayImage($('#thumbnail_'+ idDefaultImage +' a'));
	}
	$('#thumbs_list').trigger('goto', 0);
	serialScrollFixLock('', '', '', '', 0);// SerialScroll Bug on goto 0 ?	
}

Thanks

Edited by NookyBookyIV (see edit history)
Link to comment
Share on other sites

I tried the solution of "vzero", but deleting the "onchange" element in the product.tpl also delete the call of the js function at the selection of an attribute, so the other actions are not executed (update of the price for the selected attribute for example). 

I think the only solution is to modify product.js.

 

Thanks anyway for your proposal.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...