add product to all languages

tevart

Avatar: tevart

2014-02-13 07:57

Hi

Is it possible to create save button that will add new product to all languages at the same time? That way, one can create product for every language easily and just change text later.

» Quick.Cart v5.x

boboo

Avatar: boboo

2014-02-13 08:36

Yes, it is possible.
I made this for me with a clone option - the product in other languages takes over all data with one exception: the status (visibility) is not set, so the product appears in another language after I edited the description and set the status to "on".
The same with new pages.

boboo :-)

tevart

Avatar: tevart

2014-02-13 09:32

Can you advise how to make such a button?

tnx

boboo

Avatar: boboo

2014-02-13 10:19

It's easy.
Just ask in the saveProduct function for existing languages.
Then save the product so many times how many languages you have (foreach language), changing the target database with language variable.
Don't forget to do it for products_files and products_pages. Remember to set the status to "0" saving the second and next languages.
I don't know how synchronous you want to have this, but I have put the same procedures by deleting the product. If I delete a product in any language, it will be deleted in all languages.
All in all, is not so complicated.

boboo :-)

tevart

Avatar: tevart

2014-02-13 10:34

Ufff, in theory this sound easy, but i lack necessary programming skills to do this by myself. Deleting product in all languages is nice addition...tnx.

So, i need to edit actions/products-admin.php in Save product data, right?

I'm thinking this
$aForm['iProduct'] = $oFFS->throwLastId( DB_PRODUCTS, 'iProduct' ) + 1;
should be changed somehow to use lang variable for DB_PRODUCTS ?

Back to top
about us | contact