Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to add pictures for product custom options in code
 
ranjeetramta
Jr. Member
 
Total Posts:  2
Joined:  2009-06-12
 

I m using this code to add the custom product in cart from main product. I m working on sticker design project in magento. In this project user can create the stickers with some options at last one image will create according to his selection. How can i add the image in option
can anybody help me.

Ranjeet,
My Blog
Thanks.

$params= array(

‘product’ => 71,

‘related_product’ =>null ,

‘options’ => Array

(

‘3’ => Array(’0’ => 23,’1’ => 22),

‘4’ => 24,

‘6’ => $imgHei,

‘1’ => 8,

‘5’ => $imgWid,

),

‘qty’ => 1

);

$cart = Mage::getSingleton(’checkout/cart’);

$product = new Mage_Catalog_Model_Product();

$product->load(71);

$cart->addProduct($product, $params);

$cart->save();

Mage::getSingleton(’checkout/session’)->setCartWasUpdated(true);

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top