I created a new column in sales_flat_quote_item named itemcomment. i want to to insert textbox value this column.

my form .....comment.phtml

<form id="orderapproval-item-form" class="orderapproval-hidden" action="<?php echo $this->getUrl('orderapproval/customercart/remarksdecline');?>" method="post">
    <input type="text" name="message" class="orderapproval-disabled" value="<?php echo $this->__('Enter decline reason'); ?>" id="decline" />
    <input type="submit" value="<?php echo $this->__('Decline'); ?>"/>


public function remarksdeclineAction()

           $message =  $this->getRequest()->getParam('message');
           //echo $message;
           $quoteItem  = Mage::getModel('orderapproval/quoteitem');

controller is calling with echo


class ZetaPrints_OrderApproval_Model_OrderApproval extends Mage_Core_Model_Abstract

    public function _construct() {



class ZetaPrints_OrderApproval_Model_Resource_OrderApproval extends Mage_Core_Model_Resource_Mysql4_Abstract
    public function _construct()



class ZetaPrints_OrderApproval_Model_Resource_OrderApproval_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
    protected function _construct()






but i am getting Fatal error: Uncaught Error: Call to a member function setItemcomment() on boolean

table name: sales_flate_quote_item column name: itemcomment


  • anyone can help me i am very stuck about this query Dec 29, 2016 at 11:19

1 Answer 1


You have to call event and a method on that event like :


Your observer file :

class ZetaPrints_OrderApproval_Model_Observer

    public function your_method_name(Varien_Event_Observer $observer) {

        $item = $observer->getQuoteItem();
        $product = $observer->getProduct();
        $valueToset = $product->getAttributeValue(); // or any value which you want to set
        $item->setCustomField($valueToset); // here your db field name is "custom_field"
        //You can also use $item->setData('field_name',$valueToset);
        return $this;
  • i did not get you Dec 29, 2016 at 11:40
  • i have added event in config.xml and method in controller Dec 29, 2016 at 11:48
  • 1
    getAttributeValue(); is $message am i right Dec 29, 2016 at 11:49
  • @ErSarveshVTiwari, no, you have to add method in model file like model/observer which class is already mention in event area Dec 29, 2016 at 11:49
  • @ErSarveshVTiwari, you can set any value in $message Dec 29, 2016 at 11:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.