$asspId=2; //product Id
"testpricez" behave as option
$proAdd=Mage::getModel('catalog/product')->load($asspId);
$randT=rand(time(),10);
$renDta=$asspId.'_'.$randT;
$proAdd->addCustomOption('testpricez', $renDta);
$cart = Mage::getSingleton('checkout/cart');
$cart->addProduct($asspId, array(
'qty' => $qty,
)
);
$cart->save();
"testpricez" behave as option
$proAdd=Mage::getModel('catalog/product')->load($asspId);
$randT=rand(time(),10);
$renDta=$asspId.'_'.$randT;
$proAdd->addCustomOption('testpricez', $renDta);
$cart = Mage::getSingleton('checkout/cart');
$cart->addProduct($asspId, array(
'qty' => $qty,
)
);
$cart->save();
No comments:
Post a Comment