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

Name and Personal message on product page
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

I have a page for a giftvoucher, wich is a configurable product with simple products underneath (for different prices)
You can enter a personal message fr each gift voucher.
My question is how to save the message andname for each cart item in session and/or database.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TreInnova
Guru
 
Avatar
Total Posts:  465
Joined:  2009-02-20
Fano
 
niandralades - 03 February 2013 10:45 PM

I have a page for a giftvoucher, wich is a configurable product with simple products underneath (for different prices)
You can enter a personal message fr each gift voucher.
My question is how to save the message andname for each cart item in session and/or database.

Hi you should create a sales attribute in quote item,order item , invoice item. you can create a module.

<?php
$installer 
$this;
$installer->startSetup();

$installer->addAttribute("quote_item""voucer", array("type"=>"varchar"));
$installer->addAttribute("invoice_item""voucer", array("type"=>"varchar"));
$installer->addAttribute("order_item""voucer", array("type"=>"varchar"));
$installer->endSetup();
I have attaced an example.
Regards
filippo.
File Attachments
Treinnova_SalesAttributes.zip  (File Size: 3KB - Downloads: 13)
 
Magento Community Magento Community
Magento Community
Magento Community
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

he tanks for the quick reply…
its was very helpful as well.
this is only to add field to the database right?

now i also want to add the name and the message to the item when i add a product to cart..
i think this happend in the code/core/Mage/checkout/controllers/CartController

how do i add the value of the input fields to the addAction() function
can i extend the controller? or should i use an observer to do this…

 
Magento Community Magento Community
Magento Community
Magento Community
 
TreInnova
Guru
 
Avatar
Total Posts:  465
Joined:  2009-02-20
Fano
 
niandralades - 04 February 2013 08:59 AM

or should i use an observer to do this…

I would use an observer wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
niandralades
Jr. Member
 
Total Posts:  15
Joined:  2012-06-15
 

i was just reading this article:
and i was wonedring if it is possible with custom options as well..

http://mikebywaters.wordpress.com/2012/03/29/adding-custom-data-to-a-cart-item-in-magento/

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