NookyBookyIV Posted October 29, 2016 Share Posted October 29, 2016 (edited) 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 October 29, 2016 by NookyBookyIV (see edit history) Link to comment Share on other sites More sharing options...
Naldinho Posted October 29, 2016 Share Posted October 29, 2016 It is possible but you need to edit some code. I did this a while back using a tutorial that was on here. If you search for it you should be able to find a topic that explains what you need to change. Link to comment Share on other sites More sharing options...
NookyBookyIV Posted October 29, 2016 Author Share Posted October 29, 2016 (edited) Thank you, I found a topic (http://www.prestashop.com/forums/topic/114801-combinations-only-images-of-default-combination-displayed-by-default/), but it didn't work in my Prestashop 1.5.3.1. 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 October 29, 2016 by NookyBookyIV (see edit history) Link to comment Share on other sites More sharing options...
Naldinho Posted October 29, 2016 Share Posted October 29, 2016 I think this is the topic I used but it was over a year ago so not sure. https://www.prestashop.com/forums/topic/45633-solved-how-to-remove-display-all-pictures/ Link to comment Share on other sites More sharing options...
NookyBookyIV Posted October 29, 2016 Author Share Posted October 29, 2016 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now