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

Is there a way to add product options dynamically? 
 
Andre D
Jr. Member
 
Total Posts:  13
Joined:  2008-10-29
 

Is there a way to add custom product options dynamically?

I know how to dynamically set the values of product options that have been specified in the admin interface, but can you programatically add new custom options to a product in the cart?

Andre

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre D
Jr. Member
 
Total Posts:  13
Joined:  2008-10-29
 

Thank you for your reply.

We have a store that sells software. We apply discounts to some titles if the customer owns an older version. To qualify for the discount, he must input his serial number, which gets verified via an API to another server that keeps track of serial numbers.

I can handle all the serial number lookup stuff, I’m just not sure if the custom product options is the right mechanism to use in Magento. I need the serial number to be stored with the completed order. I want the user to enter the serial number in a custom input box right in the shopping cart page /checkout/cart/. I do NOT want the option to be available in the individual product page, where options are normally entered. This is because I have special logic that determines if the serial number is valid, and I’m not sure how to add this validation to the product options if they are entered in the normal way on the product page.

I can probably do this by customizing the individual product page to hide/suppress the serial number option input, but I’m wondering if there is a better way.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageGuys
Guru
 
Avatar
Total Posts:  380
Joined:  2008-06-07
 

Off hand I would try implementing this as a custom discount rule. See the SalesRule module in the core, especially the Observer and Validator models.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Andre D
Jr. Member
 
Total Posts:  13
Joined:  2008-10-29
 

Thank you so much! I’ve begun writing a custom module that builds on some of your suggestions here. I’ll post it here when I’m done.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MarvinToys
Sr. Member
 
Avatar
Total Posts:  194
Joined:  2008-07-27
 

I need this also too. Can you post yout way here, please?

Thanx from Germany,.,.

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