Hello everybuddy I am trying develping a custom component to insert multi language product with virtuemart.
need to set first a product in italian so I build a product array like this, then call vmModel('product)->store($product) and it's all ok :
$productVM["vmlang"]="it-IT";
$productVM["product_name"]="prodotto Italiano";
$productVM["slug"]="prodotto Italiano slug";
$productVM["product_s_desc"]="prodotto Italiano descrizione breve ";
...........................
and then I try this following and call again vmModel('product)->store($product), but system over write previous values in italian table :
$productVM["vmlang"]="en-GB";
$productVM["product_name"]="ENGLISH product";
$productVM["slug"]="ENGLISH-produc-slug";
$productVM["product_s_desc"]="English product description";
...........................
I assume there should be some step to change current JApplication-> set new language in the middle, but after many trial I was not able to reach them
Could someone help please?
I don't understand all your system. SImply follow the mvc patern to do it work.
For your information a final version of my tranlslator is ready, only some last testing but it work perfect.
If you try to store multiple language the best way is to do it in ajax and changing the vmlang values each time.
If you want do it with a loop then you must use setVar('vmlang';$lang) (and im not sure it work)
Simply following the mvc. What it means, sorry?
I have trying modifying the vmLang simply as you see in the first example but it does not works. Following my first example it overwrite the ..product_it_it table without inserting on en_gb
Can you confirm that editing only the vmlang variable of a product is enough?
Where I can see your component?
Thanks!
Ok I got it
I though that the first item of the array vmlang could be enough.
but it's not so manually set
$app->initialise(array(
'language' => 'en-GB'
));
$b= VmConfig::set('vmlang','en_gb');
And it seems working
Thanks