Hi,
we get a component to add products but it does not work.
The returned error message is still empty so is useless.
For this reason I need to catch the error message when the insert to the DB does not work...
So here's the code from the component:
if (!class_exists( 'VirtueMartModelProduct' )) require (JPATH_VM_ADMINISTRATOR.DS.'models'.DS.'product.php');
$modelProduct = new VirtueMartModelProduct;
...
$prod_id = $modelProduct->store($data);
So I think I'll find the fuction for store in administrator/components/com_virtuemart/models/product.php and in line 49381 I found:
public function store
Is this the right function I'm looking for?
I try something like
$fh=fopen('error.log','w');
There but error.log will never be created so I think I understand something wrong ...
I'm a novice with development.
I use Joomla 2.5.8 and VirtueMart 2.0.18a
Can somebody help me please to figure out why it does not work?
Thanks
Andre
The path was right - the log file was just created in the excecuting directory ...
So I can do loging now.
This looks correct
$modelProduct = new VirtueMartModelProduct;
...
$prod_id = $modelProduct->store($data);
the $data should be an associative array. Use vmdebug and check our used data format, you may understand then whats missing (for example virtuemart_product_id = null) or so