lucifer_1 Posted November 7, 2022 Share Posted November 7, 2022 I had a shop running on 1.6. Then i build a new one on 1.7, with 2 new languages, and after the shop was 100% ready, i used migration pro module to transfer all products etc to the new shop. 1 problem: he didn't understand there were new translations, so all products have no name in other translations.. I want to copy all product names AND rewrite urls from the first language to both other languages. How can i do that with the database? There are more then 5000 products on our shop. I don't know the sql code.. Update, insert... something like that ^^ Link to comment Share on other sites More sharing options...
ps8modules Posted November 8, 2022 Share Posted November 8, 2022 Hi. In order to get the correct sql, you need to add information. What is the table prefix? ps_ ? What is the id_language that is ok? What are the id_languages you want to update? Link to comment Share on other sites More sharing options...
ps8modules Posted November 8, 2022 Share Posted November 8, 2022 sample: UPDATE ps_product_lang t JOIN (SELECT id_product, name, link_rewrite FROM ps_product_lang t2 WHERE t2.id_lang = 1 /* good language */ ) ten ON t.id_product = ten.id_product SET t.name = ten.name, t.link_rewrite = ten.link_rewrite WHERE t.id_lang IN (2, 3); /*2,3 is language to update*/ 1 1 Link to comment Share on other sites More sharing options...
lucifer_1 Posted November 8, 2022 Author Share Posted November 8, 2022 Wow, that was really fast, updated over 7000 products within seconds haha. Thank you! 1 Link to comment Share on other sites More sharing options...
Rajeshx Posted December 6, 2022 Share Posted December 6, 2022 Hi, I have the same issue, but in my case i have 1 correct language and the other languages the product title is ok, but short description, long description, images are missing. You you give some input regarding the script i need to run to copy date from 1 correct (main) language to 5 other languages. I use prestashop v 1.7.8.5 Thanks Link to comment Share on other sites More sharing options...
ps8modules Posted December 7, 2022 Share Posted December 7, 2022 Hi. Please be specific. That is, write the id of the language that is in order and the id of the other languages that you want to update, add a short and a long description. Also explain how images can be missing when they are tied to a product ID? Do you have more stores? 1 Link to comment Share on other sites More sharing options...
Rajeshx Posted December 7, 2022 Share Posted December 7, 2022 Hi, I import the products from dropshipper. They actually support just 1 language when importing the products. For the other languages in the store all fields are empty, except product title. So there is also no picture availabe for product languages which are not the main language of the store. So i want to copy all fields from the main language to the other languages Link to comment Share on other sites More sharing options...
ps8modules Posted December 8, 2022 Share Posted December 8, 2022 Hi. How can I give you SQL if I don't have the language id? What is the id of the default language? Which language ids should be updated? I expect an answer: main language id = 1 id of other languages = 2, 3, 4, 7 1 Link to comment Share on other sites More sharing options...
Rajeshx Posted December 8, 2022 Share Posted December 8, 2022 thanks for your reply. main language id = 1 id of other languages = 2, 3, 4, 8. 9 Let me know if you need more input Link to comment Share on other sites More sharing options...
ps8modules Posted December 9, 2022 Share Posted December 9, 2022 Hi. Before running SQL in the database, back up the ps_product_lang table !!! Columns are updated: description, description_short, link_rewrite, meta_description, meta_keywords, meta_title If your table prefix is other than ps_, change it to your prefix. For example: myprefix_product_lang. It is in the code twice. UPDATE ps_product_lang t JOIN (SELECT id_product, description, description_short, link_rewrite, meta_description, meta_keywords, meta_title FROM ps_product_lang t2 WHERE t2.id_lang = 1 /* main language */ ) ten ON t.id_product = ten.id_product SET t.description = ten.description, t.description_short = ten.description_short, t.link_rewrite = ten.link_rewrite, t.meta_description = ten.meta_description, t.meta_keywords = ten.meta_keywords, t.meta_title = ten.meta_title, WHERE t.id_lang IN (2, 3, 4, 8, 9); /*2,3,4,8,9 is language to update*/ 1 Link to comment Share on other sites More sharing options...
Rajeshx Posted December 19, 2022 Share Posted December 19, 2022 thanks, i will test it Rajesh 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