tags:

views:

27

answers:

1

Hello,

How to add custom fields as well as custom images to cart in magento 1.4.1.1 ?

Any one have any idea about this???

+3  A: 

If you need add you custom product attribute to shopping cart, just add the following lines of code into your module configuration:

<config>
     <global>
          <sales>
               <quote>
                    <item>
                        <product_attributes>
                             <[your_custom_attribute_code] />
                        </product_attributes>
                    </item>
               </quote>
          </sales>
     </global>
</config>

Just replace [your_custom_attribute_code] with the code of your attribute. You may also add as many attributes as you wish, just add one more attribute into configuration.

Ivan Chepurnyi
Thank you for something new that I didn't know before.
clockworkgeek
but [your_custom_attribute_code] this code is dynamic for different attributes so it is not possible for client to follow this XML format structure.
smart
I suppose it is for developers and not for clients. By the way, the other way is to override quote_items collection, it is not possible for clients either :) Anyway, you can always write a cusotmization, that will add these attributes via Magento Admin interface to configuration of Magento. You just need to call method `Mage::getConfig()->setNode('node/path', 'nodeValue');`.
Ivan Chepurnyi