Derres Posted September 3, 2016 Share Posted September 3, 2016 (edited) There is any script/module for give to the product pictures the same name than the title at all the images ? Thanks Edited September 3, 2016 by Derres (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 3, 2016 Share Posted September 3, 2016 Assuming you have only one shop with ID 1, you could use the following query: UPDATE `ps_image_lang` il SET `legend` = ( SELECT `name` FROM `ps_product_lang` pl WHERE il.`id_lang` = pl.`id_lang` AND pl.`id_shop` = 1 AND pl.`id_product` = ( SELECT `id_product` FROM `ps_image` i WHERE i.`id_image` = il.`id_image` ) ) Note that this will overwrite all your existing image titles, so make sure to back up first. A more complicated query will be needed if you have multiple shops. Link to comment Share on other sites More sharing options...
Derres Posted September 4, 2016 Author Share Posted September 4, 2016 (edited) All done thx I have a shop multilanguage, but only one for the moment. And for limit it only to some products id ? Or for a range of products id ? Thanks Edited September 4, 2016 by Derres (see edit history) Link to comment Share on other sites More sharing options...
rocky Posted September 5, 2016 Share Posted September 5, 2016 You can add the following to the end of the query above to restrict to some product IDs: WHERE il.`id_image` IN ( SELECT `id_image` FROM `ps_image` i WHERE i.`id_product` IN (4, 5, 6) ) Change 4, 5, 6 to the IDs of the products you want to update. Or you can add the following to the end of the query for a range of products: WHERE il.`id_image` IN ( SELECT `id_image` FROM `ps_image` i WHERE i.`id_product` >= 4 AND i.`id_product` <= 6 ) Change 4 to the lowest product ID you want updated and 6 to the highest product ID. 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