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 Populate Custom Option fields programmatically
 
darfine
Jr. Member
 
Total Posts:  5
Joined:  2009-06-11
 

I’ve created a small .phtml file that allows the customer to select up to 4 custom color inks from a color swatch for personalizing his/her product. I’ve included the phtml block on the product page and it works fine, but I’m not clear on how to save the customer’s selections to the DB when adding an item to their shopping cart.

I’m assuming that I need to create custom options for the product (in this case, 4 options, titled Color #1, Color #2, etc.). But I don’t know how to have my code populate these fields.

Any ideas out there?

Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
kiatng
Enthusiast
 
Total Posts:  875
Joined:  2008-09-03
Kuala Lumpur, Malaysia
 

Is there a reason why you choose not to add attributes to the product using the built-in Manage Attributes in the backend? The attributes will be saved to the Quote object when the product is added to the cart and passed to the Order object in checkout.

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