Jump to content

Copy all product names and rewrite urls from language to other language database


lucifer_1

Recommended Posts

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

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*/

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 4 weeks later...

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

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

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*/

 

  • Thanks 1
Link to comment
Share on other sites

  • 2 weeks later...

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...