VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Coding Central => Topic started by: andrew.overlord on September 09, 2013, 16:48:13 PM

Title: Save product with Product Model -> store() ?
Post by: andrew.overlord 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)
Title: Re: Save product with Product Model -> store() ?
Post by: andrew.overlord on September 09, 2013, 20:16:07 PM
additional info:

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