News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Clone product

Started by frankiefredericks, April 24, 2013, 09:52:58 AM

Previous topic - Next topic

frankiefredericks

Hi,

I know I already posted the question, feel free to remove it if I'm wrong, but I think I posted in the wrong board.

I'm trying to clone a product giving the id, using the model createClone method. But it seems it doesn't do anything. If I get the id returned from the method, it gives me the same id I passed and no product is cloned.

Am I doing something wrong or just I'm trying to do something impossible? Here's my code:

Thanks again


if (!class_exists('VmConfig')) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'config.php');
$config = VmConfig::loadConfig();
if (!class_exists('VmModel')) require(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_virtuemart'.DS.'helpers'.DS.'vmmodel.php');
$model = VmModel::getModel('product'); //print_r($model);
echo " id=".$model->createClone($id);