Author Topic: Save product with Product Model -> store() ?  (Read 1880 times)

andrew.overlord

  • Beginner
  • *
  • Posts: 14
Save product with Product Model -> store() ?
« on: September 09, 2013, 16:48:13 pm »
Hi!
I'm trying to write a component for importing product through uploaded pricelist.
I'm using VmModel::getModel ('product')->store($mydata).
The data is written successfully #__virtuemart_products_LANG table, but the #__virtuemart_products table is empty.
What am I doing wrong?
Thanx. (Sorry for my bad english)

andrew.overlord

  • Beginner
  • *
  • Posts: 14
Re: Save product with Product Model -> store() ?
« Reply #1 on: September 09, 2013, 20:16:07 pm »
additional info:
Code: [Select]
$product_data=array(
            'virtuemart_product_id'=>ID HERE,
            'virtuemart_vendor_id'=>'',
            'product_parent_id'=>'',
            'product_sku'=>'',
            'product_name'=>'',
            'slug'=>'',
            'product_s_desc'=>'',
            'product_desc'=>'',
            'product_weigth'=>'',
            'product_width'=>'',
            'product_heigth'=>'',
            'product_lwh_uom'=>'',
            'product_url'=>'',
            'product_in_stok'=>'',
            'product_ordered'=>'',
            'low_stok_notification'=>'',
            'product_available_date'=>'',
            'product_availability'=>'',
            'product_special'=>'',
            'pordering'=>'',
            'product_unit'=>'',
            'product_packaging'=>'',
            'product_params'=>'',
            'intnotes'=>'',       
        );
If the product exists with 'virtuemart_product_id' - it's work (save changes).
If I don't use 'virtuemart_product_id' it's work too (simply add value to DB).