how to create new custom options type in magento?

Mufaddal picture Mufaddal · May 8, 2012 · Viewed 7.5k times · Source

How to create new product custom options type in magento, for example I have to give new image custom option type in magento which fetch image from my custom module table and I want to assign that image to my custom options image field .

Answer

Dmytro Zavalkin picture Dmytro Zavalkin · Sep 28, 2012

As Dustin Graham said, it is very tricky. First steps:

  1. Add new node under global/catalog/product/options/custom/groups. See examples in /app/code/core/Mage/Catalog/etc/config.xml.

  2. Create new block to render your custom option.

  3. Rewrite Mage_Catalog_Model_Product_Option and implement saving your custom type options (saveOptions() method) and loading your custom type options (getProductOptionCollection method).

If your custom type isn't very custom :) - it should be enough.