SkyHiRider Posted February 20, 2014 Share Posted February 20, 2014 I don't have enough knowledge about the PrestaShop database sheme to create such a script. Can someone share a simple update script that would do just that - copy one text field from each product into another text field of the same product? Thanks, Marek Link to comment Share on other sites More sharing options...
Prestashopconector Posted February 20, 2014 Share Posted February 20, 2014 (edited) if its the same product and you wanna copy data from a field to another you can do a simple update script on the same table record, imagine your product id = 1 and the field "a" is the field you wanna copy into field "b", do this, update ps_product set b=a where product_id = 1 if you want to do for all the products in the table avoid the where statement. Is this what do you want to do ?? Edited December 9, 2014 by nadie Moderación del foro edita el mensaje: Quitado enlace de publicidad | Firma debe ir en la firma (see edit history) Link to comment Share on other sites More sharing options...
SkyHiRider Posted February 21, 2014 Author Share Posted February 21, 2014 if its the same product and you wanna copy data from a field to another you can do a simple update script on the same table record, imagine your product id = 1 and the field "a" is the field you wanna copy into field "b", do this, update ps_product set b=a where product_id = 1 if you want to do for all the products in the table avoid the where statement. Is this what do you want to do ?? http://www.prestashopconector.com Yes, but I have no idea where the name and code are stored. I've had a quick look at the Ps erd but am not any wiser, as every text field is it's own entity due to the multilanguage capabilities of PrestaShop. Link to comment Share on other sites More sharing options...
Prestashopconector Posted February 21, 2014 Share Posted February 21, 2014 (edited) product name is stored in ps_product_lang table with rest of text information, as description, shor description, name etc... and products id, price, quantity and other foreing keys refered to the product (categories etc) are stored in ps_product table so "product name" into "product reference" will be something like this: update ps_product p join ps_product_lang pla on p.id_product = pla.id_product set p.reference = pla.name if you are using multilanguage you have so many records in ps_product_lang as languages you have per each product, so the relation between ps_product and ps_product_lang is 1 to many, so if you have diferent names for each product language you will need to chouse one as the reference, because reference is unique per product... add a where statement to filter which language you gonna use as the default for the reference information Edited December 9, 2014 by nadie Moderación del foro edita el mensaje: Quitado enlace de publicidad | Firma debe ir en la firma (see edit history) 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