tif Posted June 6, 2010 Share Posted June 6, 2010 Hi,I am having some issues with my product pictures.Most of my products come in different colors. So I upload all the images when i create the products. But on my website, once i click on the product, once i select a color with the attribute dropdown list, all the images disappear except one, but not the one that i selected.i also tried to insert an image such as a page of all the color attributes thumbnails (on PDF) when i create the product with the product description, but i don't know how, because it asks for an image url, instead of giving me a "browse" and select option... I have over hundreds of products. Is there a faster way to attach the products attribute images to the products? How can i setup so that when the customer select an attribute, the picture for that attribute will show up? Thank you Link to comment Share on other sites More sharing options...
rocky Posted June 6, 2010 Share Posted June 6, 2010 The easiest way is to perform an SQL query using phpMyAdmin to attach every product image to each combination. See my post here. Link to comment Share on other sites More sharing options...
tif Posted June 6, 2010 Author Share Posted June 6, 2010 Hi,I read the post. But I don't understand... don't know anything about SQL... Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 You need to log in to your cPanel, choose "phpMyAdmin" in the "Databases" section, then click the SQL button in the left column or the SQL tab in the right column, then enter the SQL query and click "Go". Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 Thank you.How do i know what is the prefix for my database? i just want to make sure i don't mess anything up... never did this before... Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 Click on your database name under "information_schema" to see a list of all the tables in your database. The first few characters of each table should be "ps_" or something similar. Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 I don't see that... i'm attaching the print screen... Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 That's the information schema, not your database tables. You need to go back and click the database link below the information schema link. Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 not sure... is it this? Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 No. Weird, I can't see any PrestaShop database in there. Are you sure you selected the right website and database? There must be a PrestaShop database somewhere, otherwise your site wouldn't work.EDIT: Actually, I see there are quite a few databases there, but I'm not sure which is your PrestaShop database. Check config/settings.inc.php to find out which database PrestaShop is using. Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 sorry... i'm so clueless.... this? Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 Yes, that's it. It looks like your database prefix is "ps_". You should now be able to click the SQL button and execute an SQL query on that database, but you should click on the "ps_product_attribute_images" table, then click the Export tab export the table, so that you can restore it later if something goes wrong. Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 Ok. so I exported the table... i think... in sql format and saved it on my computer...now, i click on SQL tab, and copy paste this:TRUNCATE `ps_product_attribute_image`;INSERT INTO `ps_product_attribute_image` SELECT `id_product_attribute`, `id_image` FROM `ps_product_attribute` pa LEFT JOIN `ps_image` i ON (pa.`id_product` = i.`id_product`); right? Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 Right. That will link every image on each product to every combination on that product. Link to comment Share on other sites More sharing options...
tif Posted June 7, 2010 Author Share Posted June 7, 2010 Yes it worked!!! Thank you so much!!! I posted other questions on the forum... sorry, just started with Prestashop and don't know much coding... thanx for the help! Link to comment Share on other sites More sharing options...
rocky Posted June 7, 2010 Share Posted June 7, 2010 Glad I could help. Please edit your first post and change PLEASE HELP: to [sOLVED] Link to comment Share on other sites More sharing options...
goosedesign Posted August 19, 2010 Share Posted August 19, 2010 Think I've figured this one out as it was completely unsustainable to keep linking everything. The edits below leave the feature still working to show the correct image if you have linked them, but without hiding the rest.In yourtheme/js/product.js, just comment out the bit that hides the thumb list, and in place of "i", put the maximum number of images you expect to have (I put 10), otherwise the thumbs list will only be wide enough for the number of images that are linked to the attribute. Affected lines for me are 309 and 318. Result looks like: // 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) $('#thumbs_list_frame').width((parseInt(($('#thumbs_list_frame >li').width())* 10) + 3) + 'px'); // Bug IE6, needs 3 pixels more ? $('#thumbs_list').trigger('goto', 0); serialScrollFixLock('', '', '', '', 0);// SerialScroll Bug on goto 0 ? } 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