-- HikaShop version -- : 2.6.1
-- Error-message(debug-mod must be tuned on) -- : 500 server error
Hi there.
I'm going to add a single product to hikashop by it's api for custom php codes. I load joomla framework and hikashop helper.php fine. I even can load a single product ang get it's fields.
Now I want to add a product, and when I write $product->save($product); it gives me 500 server error. My codes:
$product = hikashop_get('class.product');
$product->product_name = "vahid product test";
$product->product_quantity = 5;
$product->product_published = 1;
//$product->product_tax_id = 11;
$product->product_weight = 1;
$product->product_weight_unit = "kg";
//$product->product_min_per_order = $min_order;
$product->product_type = "main";
$product->product_access = "all";
/*$product->product_manufacturer_id = $id_merek;
$product->grup = $grup;
$product->tipe = $tipe;
$product->unit = $unit;*/
$product->prices = array(15000);
$product->categories = array(17);
$product->save($product);