Custom attribute custom_attribute to quote & order table save from controllerCreate invoice and shipment in magento via cron based on store view and order ageAdd custom field to IWD One page Checkout ExtensionMagento: Adding block from observer programmaticallyShopping cart is empty after cancel the payment in magento-1.9.1.1M1 CE, paypal exception “PayPal NVP gateway errors”SOLVED Magento 1.9 cannot place order “Some transactions have not been committed or rolled back”Magento2 Quote Table to Order items table?Get Shipment Id while creating Shipment in Magento 1.9could not locate setShippingMethod function in magento 1.9Magento 1.9 : sales_flat_order and sales_flat_order_grid tables are not updating

Cayley's Matrix Notation

Drawing a german abacus as in the books of Adam Ries

Can I criticise the more senior developers around me for not writing clean code?

Is there metaphorical meaning of "aus der Haft entlassen"?

What does "function" actually mean in music?

As an international instructor, should I openly talk about my accent?

Trouble removing package using Yum on CentOS7

All ASCII characters with a given bit count

Multiple fireplaces in an apartment building?

Does a large simulator bay have standard public address announcements?

What is the most expensive material in the world that could be used to create Pun-Pun's lute?

Is it acceptable to use working hours to read general interest books?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

A Paper Record is What I Hamper

Apply a different color ramp to subset of categorized symbols in QGIS?

Contradiction proof for inequality of P and NP?

Find the identical rows in a matrix

Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?

Injection into a proper class and choice without regularity

What is this word supposed to be?

Work requires me to come in early to start computer but wont let me clock in to get paid for it

Can someone publish a story that happened to you?

Was Dennis Ritchie being too modest in this quote about C and Pascal?

Why do distances seem to matter in the Foundation world?



Custom attribute custom_attribute to quote & order table save from controller


Create invoice and shipment in magento via cron based on store view and order ageAdd custom field to IWD One page Checkout ExtensionMagento: Adding block from observer programmaticallyShopping cart is empty after cancel the payment in magento-1.9.1.1M1 CE, paypal exception “PayPal NVP gateway errors”SOLVED Magento 1.9 cannot place order “Some transactions have not been committed or rolled back”Magento2 Quote Table to Order items table?Get Shipment Id while creating Shipment in Magento 1.9could not locate setShippingMethod function in magento 1.9Magento 1.9 : sales_flat_order and sales_flat_order_grid tables are not updating






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I have added one Custom attribute custom_attribute to quote & order table I am sending a response to my controller I want to save the response in my custom_attribute to sales_flat_quote & sales_flat_order table
can someone please help me how to achieve this



 $response = $this->getRequest()->getParam('data'); // i am getting response here in my controller 

$quoteModelInstance = Mage::getSingleton('checkout/session')->getQuote();
$customerModelInstance = Mage::getSingleton('customer/session');

$order = Mage::getModel('sales/order');
$order->setQuote($quoteModelInstance);
$order->setCustomAttribute($response);
try
$order->save();

catch (Exception $e)

Mage::logException($e);










share|improve this question
















bumped to the homepage by Community 3 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • can you please add your code for addition clarification?

    – Vino
    Jul 20 '17 at 5:30











  • @vino Updated s

    – magento12345
    Jul 20 '17 at 5:34











  • you missed $ for response variable.

    – Vino
    Jul 20 '17 at 5:37











  • Did you try $order->setData( 'custom_attribute',$response );

    – Vino
    Jul 20 '17 at 5:42











  • Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

    – Nagaraju Kasa
    Jul 20 '17 at 6:02

















0















I have added one Custom attribute custom_attribute to quote & order table I am sending a response to my controller I want to save the response in my custom_attribute to sales_flat_quote & sales_flat_order table
can someone please help me how to achieve this



 $response = $this->getRequest()->getParam('data'); // i am getting response here in my controller 

$quoteModelInstance = Mage::getSingleton('checkout/session')->getQuote();
$customerModelInstance = Mage::getSingleton('customer/session');

$order = Mage::getModel('sales/order');
$order->setQuote($quoteModelInstance);
$order->setCustomAttribute($response);
try
$order->save();

catch (Exception $e)

Mage::logException($e);










share|improve this question
















bumped to the homepage by Community 3 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • can you please add your code for addition clarification?

    – Vino
    Jul 20 '17 at 5:30











  • @vino Updated s

    – magento12345
    Jul 20 '17 at 5:34











  • you missed $ for response variable.

    – Vino
    Jul 20 '17 at 5:37











  • Did you try $order->setData( 'custom_attribute',$response );

    – Vino
    Jul 20 '17 at 5:42











  • Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

    – Nagaraju Kasa
    Jul 20 '17 at 6:02













0












0








0








I have added one Custom attribute custom_attribute to quote & order table I am sending a response to my controller I want to save the response in my custom_attribute to sales_flat_quote & sales_flat_order table
can someone please help me how to achieve this



 $response = $this->getRequest()->getParam('data'); // i am getting response here in my controller 

$quoteModelInstance = Mage::getSingleton('checkout/session')->getQuote();
$customerModelInstance = Mage::getSingleton('customer/session');

$order = Mage::getModel('sales/order');
$order->setQuote($quoteModelInstance);
$order->setCustomAttribute($response);
try
$order->save();

catch (Exception $e)

Mage::logException($e);










share|improve this question
















I have added one Custom attribute custom_attribute to quote & order table I am sending a response to my controller I want to save the response in my custom_attribute to sales_flat_quote & sales_flat_order table
can someone please help me how to achieve this



 $response = $this->getRequest()->getParam('data'); // i am getting response here in my controller 

$quoteModelInstance = Mage::getSingleton('checkout/session')->getQuote();
$customerModelInstance = Mage::getSingleton('customer/session');

$order = Mage::getModel('sales/order');
$order->setQuote($quoteModelInstance);
$order->setCustomAttribute($response);
try
$order->save();

catch (Exception $e)

Mage::logException($e);







magento-1.9






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 20 '17 at 5:34







magento12345

















asked Jul 20 '17 at 5:07









magento12345magento12345

171217




171217





bumped to the homepage by Community 3 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 3 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • can you please add your code for addition clarification?

    – Vino
    Jul 20 '17 at 5:30











  • @vino Updated s

    – magento12345
    Jul 20 '17 at 5:34











  • you missed $ for response variable.

    – Vino
    Jul 20 '17 at 5:37











  • Did you try $order->setData( 'custom_attribute',$response );

    – Vino
    Jul 20 '17 at 5:42











  • Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

    – Nagaraju Kasa
    Jul 20 '17 at 6:02

















  • can you please add your code for addition clarification?

    – Vino
    Jul 20 '17 at 5:30











  • @vino Updated s

    – magento12345
    Jul 20 '17 at 5:34











  • you missed $ for response variable.

    – Vino
    Jul 20 '17 at 5:37











  • Did you try $order->setData( 'custom_attribute',$response );

    – Vino
    Jul 20 '17 at 5:42











  • Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

    – Nagaraju Kasa
    Jul 20 '17 at 6:02
















can you please add your code for addition clarification?

– Vino
Jul 20 '17 at 5:30





can you please add your code for addition clarification?

– Vino
Jul 20 '17 at 5:30













@vino Updated s

– magento12345
Jul 20 '17 at 5:34





@vino Updated s

– magento12345
Jul 20 '17 at 5:34













you missed $ for response variable.

– Vino
Jul 20 '17 at 5:37





you missed $ for response variable.

– Vino
Jul 20 '17 at 5:37













Did you try $order->setData( 'custom_attribute',$response );

– Vino
Jul 20 '17 at 5:42





Did you try $order->setData( 'custom_attribute',$response );

– Vino
Jul 20 '17 at 5:42













Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

– Nagaraju Kasa
Jul 20 '17 at 6:02





Please confirm the table names sales_flat_quote (or) sales_flat_quote_item ?

– Nagaraju Kasa
Jul 20 '17 at 6:02










2 Answers
2






active

oldest

votes


















0














Here I am showing you how to save the values in the sales_flat_order table using checkout_submit_all_after event and observer concept.



Step-1: From your custom controller set the value into session as shown below




/app/code/local/Namespace/ModuleName/controllers/IndexController.php




public function customAction()

$productPayDetails=$this->getRequest()->getPost();//get post values
//write your code here
.
.


$myValue = 2;
Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

(or)

Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();
.
.
$testValue = 10; //Ex: Your attribute value
Mage::getSingleton('core/session')->setCustomerPaymentTotal($testValue);
Mage::getSingleton('core/session')->setCustomerPendingTotal($testValue);



Screen shot: http://prntscr.com/fxz7eu



Step 2: Now Configure an event in config.xml from your custom module




/app/code/local/Namespace/ModuleName/et/config.xml




 <frontend>
<events>
<checkout_submit_all_after>
<observers>
<checkout_submit_all_after>
<class>intermediatepage/observer</class>
<method>checkout_submit_all_after</method>
</checkout_submit_all_after>
</observers>
</checkout_submit_all_after>
</events>
</frontend>


Note: Here i am taking an example with intermediatepage class name



Step 3: Now Create a column in the sales_flat_order for example as shown in the
screenshot http://prntscr.com/fxxqgt



Step 4: create an observer file




/app/code/local/Namespace/ModuleName/Model/Observer.php




<?php

class Namespace_ModuleName_Model_Observer

public function checkout_submit_all_after(Varien_Event_Observer $observer)

$order = $observer->getEvent()->getOrder();
$pendingtotal=Mage::getSingleton('core/session')->getCustomerPendingTotal();
$paymenttotal=Mage::getSingleton('core/session')->getCustomerPaymentTotal();
$order->setOrderPendingPayment($pendingtotal);
$order->setOrderPaymentNow($paymenttotal);
$order->save();

//unset the session values
Mage::getSingleton('core/session')->getCustomerPendingTotal('');
Mage::getSingleton('core/session')->getCustomerPendingTotal('');






Step 5: after done the changes in xml please remove cache and session and please try this in default magento from your custom module in locally.






share|improve this answer

























  • where you are getting the current quote Order ?

    – magento12345
    Jul 20 '17 at 7:17











  • Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

    – Nagaraju Kasa
    Jul 20 '17 at 7:34











  • hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

    – Nagaraju Kasa
    Jul 20 '17 at 8:49


















0














I found another very easy solution for this please follow the steps below:



Step 1:
in your controller action please save the custom attribute value as shown below



Note:- You should create a column for saving the value in sales_flat_quote table
Ex: custom_attribute is the name of the column i have created



public function customAction()

$productPayDetails=$this->getRequest()->getPost();//get post values

$myValue = 2;

Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

(or)

Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();




Step 2: Create a column in the name of custom_attribute in sales_flat_order table



Step 3: now keep the below code in between global tag from config.xml from your custom module



<global> 
<fieldsets>
<sales_convert_quote>
<custom_attribute>
<to_order>*</to_order>
</custom_attribute>
</sales_convert_quote>
<sales_convert_order>
<custom_attribute>
<to_quote>*</to_quote>
</custom_attribute>
</sales_convert_order>
</fieldsets>
</global>


clear cache and session and create an order and check the database.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184582%2fcustom-attribute-custom-attribute-to-quote-order-table-save-from-controller%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Here I am showing you how to save the values in the sales_flat_order table using checkout_submit_all_after event and observer concept.



    Step-1: From your custom controller set the value into session as shown below




    /app/code/local/Namespace/ModuleName/controllers/IndexController.php




    public function customAction()

    $productPayDetails=$this->getRequest()->getPost();//get post values
    //write your code here
    .
    .


    $myValue = 2;
    Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

    (or)

    Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();
    .
    .
    $testValue = 10; //Ex: Your attribute value
    Mage::getSingleton('core/session')->setCustomerPaymentTotal($testValue);
    Mage::getSingleton('core/session')->setCustomerPendingTotal($testValue);



    Screen shot: http://prntscr.com/fxz7eu



    Step 2: Now Configure an event in config.xml from your custom module




    /app/code/local/Namespace/ModuleName/et/config.xml




     <frontend>
    <events>
    <checkout_submit_all_after>
    <observers>
    <checkout_submit_all_after>
    <class>intermediatepage/observer</class>
    <method>checkout_submit_all_after</method>
    </checkout_submit_all_after>
    </observers>
    </checkout_submit_all_after>
    </events>
    </frontend>


    Note: Here i am taking an example with intermediatepage class name



    Step 3: Now Create a column in the sales_flat_order for example as shown in the
    screenshot http://prntscr.com/fxxqgt



    Step 4: create an observer file




    /app/code/local/Namespace/ModuleName/Model/Observer.php




    <?php

    class Namespace_ModuleName_Model_Observer

    public function checkout_submit_all_after(Varien_Event_Observer $observer)

    $order = $observer->getEvent()->getOrder();
    $pendingtotal=Mage::getSingleton('core/session')->getCustomerPendingTotal();
    $paymenttotal=Mage::getSingleton('core/session')->getCustomerPaymentTotal();
    $order->setOrderPendingPayment($pendingtotal);
    $order->setOrderPaymentNow($paymenttotal);
    $order->save();

    //unset the session values
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');






    Step 5: after done the changes in xml please remove cache and session and please try this in default magento from your custom module in locally.






    share|improve this answer

























    • where you are getting the current quote Order ?

      – magento12345
      Jul 20 '17 at 7:17











    • Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

      – Nagaraju Kasa
      Jul 20 '17 at 7:34











    • hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

      – Nagaraju Kasa
      Jul 20 '17 at 8:49















    0














    Here I am showing you how to save the values in the sales_flat_order table using checkout_submit_all_after event and observer concept.



    Step-1: From your custom controller set the value into session as shown below




    /app/code/local/Namespace/ModuleName/controllers/IndexController.php




    public function customAction()

    $productPayDetails=$this->getRequest()->getPost();//get post values
    //write your code here
    .
    .


    $myValue = 2;
    Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

    (or)

    Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();
    .
    .
    $testValue = 10; //Ex: Your attribute value
    Mage::getSingleton('core/session')->setCustomerPaymentTotal($testValue);
    Mage::getSingleton('core/session')->setCustomerPendingTotal($testValue);



    Screen shot: http://prntscr.com/fxz7eu



    Step 2: Now Configure an event in config.xml from your custom module




    /app/code/local/Namespace/ModuleName/et/config.xml




     <frontend>
    <events>
    <checkout_submit_all_after>
    <observers>
    <checkout_submit_all_after>
    <class>intermediatepage/observer</class>
    <method>checkout_submit_all_after</method>
    </checkout_submit_all_after>
    </observers>
    </checkout_submit_all_after>
    </events>
    </frontend>


    Note: Here i am taking an example with intermediatepage class name



    Step 3: Now Create a column in the sales_flat_order for example as shown in the
    screenshot http://prntscr.com/fxxqgt



    Step 4: create an observer file




    /app/code/local/Namespace/ModuleName/Model/Observer.php




    <?php

    class Namespace_ModuleName_Model_Observer

    public function checkout_submit_all_after(Varien_Event_Observer $observer)

    $order = $observer->getEvent()->getOrder();
    $pendingtotal=Mage::getSingleton('core/session')->getCustomerPendingTotal();
    $paymenttotal=Mage::getSingleton('core/session')->getCustomerPaymentTotal();
    $order->setOrderPendingPayment($pendingtotal);
    $order->setOrderPaymentNow($paymenttotal);
    $order->save();

    //unset the session values
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');






    Step 5: after done the changes in xml please remove cache and session and please try this in default magento from your custom module in locally.






    share|improve this answer

























    • where you are getting the current quote Order ?

      – magento12345
      Jul 20 '17 at 7:17











    • Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

      – Nagaraju Kasa
      Jul 20 '17 at 7:34











    • hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

      – Nagaraju Kasa
      Jul 20 '17 at 8:49













    0












    0








    0







    Here I am showing you how to save the values in the sales_flat_order table using checkout_submit_all_after event and observer concept.



    Step-1: From your custom controller set the value into session as shown below




    /app/code/local/Namespace/ModuleName/controllers/IndexController.php




    public function customAction()

    $productPayDetails=$this->getRequest()->getPost();//get post values
    //write your code here
    .
    .


    $myValue = 2;
    Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

    (or)

    Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();
    .
    .
    $testValue = 10; //Ex: Your attribute value
    Mage::getSingleton('core/session')->setCustomerPaymentTotal($testValue);
    Mage::getSingleton('core/session')->setCustomerPendingTotal($testValue);



    Screen shot: http://prntscr.com/fxz7eu



    Step 2: Now Configure an event in config.xml from your custom module




    /app/code/local/Namespace/ModuleName/et/config.xml




     <frontend>
    <events>
    <checkout_submit_all_after>
    <observers>
    <checkout_submit_all_after>
    <class>intermediatepage/observer</class>
    <method>checkout_submit_all_after</method>
    </checkout_submit_all_after>
    </observers>
    </checkout_submit_all_after>
    </events>
    </frontend>


    Note: Here i am taking an example with intermediatepage class name



    Step 3: Now Create a column in the sales_flat_order for example as shown in the
    screenshot http://prntscr.com/fxxqgt



    Step 4: create an observer file




    /app/code/local/Namespace/ModuleName/Model/Observer.php




    <?php

    class Namespace_ModuleName_Model_Observer

    public function checkout_submit_all_after(Varien_Event_Observer $observer)

    $order = $observer->getEvent()->getOrder();
    $pendingtotal=Mage::getSingleton('core/session')->getCustomerPendingTotal();
    $paymenttotal=Mage::getSingleton('core/session')->getCustomerPaymentTotal();
    $order->setOrderPendingPayment($pendingtotal);
    $order->setOrderPaymentNow($paymenttotal);
    $order->save();

    //unset the session values
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');






    Step 5: after done the changes in xml please remove cache and session and please try this in default magento from your custom module in locally.






    share|improve this answer















    Here I am showing you how to save the values in the sales_flat_order table using checkout_submit_all_after event and observer concept.



    Step-1: From your custom controller set the value into session as shown below




    /app/code/local/Namespace/ModuleName/controllers/IndexController.php




    public function customAction()

    $productPayDetails=$this->getRequest()->getPost();//get post values
    //write your code here
    .
    .


    $myValue = 2;
    Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

    (or)

    Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();
    .
    .
    $testValue = 10; //Ex: Your attribute value
    Mage::getSingleton('core/session')->setCustomerPaymentTotal($testValue);
    Mage::getSingleton('core/session')->setCustomerPendingTotal($testValue);



    Screen shot: http://prntscr.com/fxz7eu



    Step 2: Now Configure an event in config.xml from your custom module




    /app/code/local/Namespace/ModuleName/et/config.xml




     <frontend>
    <events>
    <checkout_submit_all_after>
    <observers>
    <checkout_submit_all_after>
    <class>intermediatepage/observer</class>
    <method>checkout_submit_all_after</method>
    </checkout_submit_all_after>
    </observers>
    </checkout_submit_all_after>
    </events>
    </frontend>


    Note: Here i am taking an example with intermediatepage class name



    Step 3: Now Create a column in the sales_flat_order for example as shown in the
    screenshot http://prntscr.com/fxxqgt



    Step 4: create an observer file




    /app/code/local/Namespace/ModuleName/Model/Observer.php




    <?php

    class Namespace_ModuleName_Model_Observer

    public function checkout_submit_all_after(Varien_Event_Observer $observer)

    $order = $observer->getEvent()->getOrder();
    $pendingtotal=Mage::getSingleton('core/session')->getCustomerPendingTotal();
    $paymenttotal=Mage::getSingleton('core/session')->getCustomerPaymentTotal();
    $order->setOrderPendingPayment($pendingtotal);
    $order->setOrderPaymentNow($paymenttotal);
    $order->save();

    //unset the session values
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');
    Mage::getSingleton('core/session')->getCustomerPendingTotal('');






    Step 5: after done the changes in xml please remove cache and session and please try this in default magento from your custom module in locally.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 20 '17 at 8:52

























    answered Jul 20 '17 at 6:40









    Nagaraju KasaNagaraju Kasa

    2,80621742




    2,80621742












    • where you are getting the current quote Order ?

      – magento12345
      Jul 20 '17 at 7:17











    • Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

      – Nagaraju Kasa
      Jul 20 '17 at 7:34











    • hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

      – Nagaraju Kasa
      Jul 20 '17 at 8:49

















    • where you are getting the current quote Order ?

      – magento12345
      Jul 20 '17 at 7:17











    • Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

      – Nagaraju Kasa
      Jul 20 '17 at 7:34











    • hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

      – Nagaraju Kasa
      Jul 20 '17 at 8:49
















    where you are getting the current quote Order ?

    – magento12345
    Jul 20 '17 at 7:17





    where you are getting the current quote Order ?

    – magento12345
    Jul 20 '17 at 7:17













    Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

    – Nagaraju Kasa
    Jul 20 '17 at 7:34





    Actually i have explained u point no 2 , this is for saving the custom value in the order table just try this and get back with u r doubts thanks

    – Nagaraju Kasa
    Jul 20 '17 at 7:34













    hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

    – Nagaraju Kasa
    Jul 20 '17 at 8:49





    hi@ magento12345 please check now i have updated the code now please check now u can save the data into sales_flat_quote & sales_flat_order tables

    – Nagaraju Kasa
    Jul 20 '17 at 8:49













    0














    I found another very easy solution for this please follow the steps below:



    Step 1:
    in your controller action please save the custom attribute value as shown below



    Note:- You should create a column for saving the value in sales_flat_quote table
    Ex: custom_attribute is the name of the column i have created



    public function customAction()

    $productPayDetails=$this->getRequest()->getPost();//get post values

    $myValue = 2;

    Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

    (or)

    Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();




    Step 2: Create a column in the name of custom_attribute in sales_flat_order table



    Step 3: now keep the below code in between global tag from config.xml from your custom module



    <global> 
    <fieldsets>
    <sales_convert_quote>
    <custom_attribute>
    <to_order>*</to_order>
    </custom_attribute>
    </sales_convert_quote>
    <sales_convert_order>
    <custom_attribute>
    <to_quote>*</to_quote>
    </custom_attribute>
    </sales_convert_order>
    </fieldsets>
    </global>


    clear cache and session and create an order and check the database.






    share|improve this answer





























      0














      I found another very easy solution for this please follow the steps below:



      Step 1:
      in your controller action please save the custom attribute value as shown below



      Note:- You should create a column for saving the value in sales_flat_quote table
      Ex: custom_attribute is the name of the column i have created



      public function customAction()

      $productPayDetails=$this->getRequest()->getPost();//get post values

      $myValue = 2;

      Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

      (or)

      Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();




      Step 2: Create a column in the name of custom_attribute in sales_flat_order table



      Step 3: now keep the below code in between global tag from config.xml from your custom module



      <global> 
      <fieldsets>
      <sales_convert_quote>
      <custom_attribute>
      <to_order>*</to_order>
      </custom_attribute>
      </sales_convert_quote>
      <sales_convert_order>
      <custom_attribute>
      <to_quote>*</to_quote>
      </custom_attribute>
      </sales_convert_order>
      </fieldsets>
      </global>


      clear cache and session and create an order and check the database.






      share|improve this answer



























        0












        0








        0







        I found another very easy solution for this please follow the steps below:



        Step 1:
        in your controller action please save the custom attribute value as shown below



        Note:- You should create a column for saving the value in sales_flat_quote table
        Ex: custom_attribute is the name of the column i have created



        public function customAction()

        $productPayDetails=$this->getRequest()->getPost();//get post values

        $myValue = 2;

        Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

        (or)

        Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();




        Step 2: Create a column in the name of custom_attribute in sales_flat_order table



        Step 3: now keep the below code in between global tag from config.xml from your custom module



        <global> 
        <fieldsets>
        <sales_convert_quote>
        <custom_attribute>
        <to_order>*</to_order>
        </custom_attribute>
        </sales_convert_quote>
        <sales_convert_order>
        <custom_attribute>
        <to_quote>*</to_quote>
        </custom_attribute>
        </sales_convert_order>
        </fieldsets>
        </global>


        clear cache and session and create an order and check the database.






        share|improve this answer















        I found another very easy solution for this please follow the steps below:



        Step 1:
        in your controller action please save the custom attribute value as shown below



        Note:- You should create a column for saving the value in sales_flat_quote table
        Ex: custom_attribute is the name of the column i have created



        public function customAction()

        $productPayDetails=$this->getRequest()->getPost();//get post values

        $myValue = 2;

        Mage::getSingleton("checkout/cart")->getQuote()->setCustomAttribute($myValue)->save();

        (or)

        Mage::getSingleton("checkout/session")->getQuote()->setCustomAttribute($myValue)->save();




        Step 2: Create a column in the name of custom_attribute in sales_flat_order table



        Step 3: now keep the below code in between global tag from config.xml from your custom module



        <global> 
        <fieldsets>
        <sales_convert_quote>
        <custom_attribute>
        <to_order>*</to_order>
        </custom_attribute>
        </sales_convert_quote>
        <sales_convert_order>
        <custom_attribute>
        <to_quote>*</to_quote>
        </custom_attribute>
        </sales_convert_order>
        </fieldsets>
        </global>


        clear cache and session and create an order and check the database.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jul 20 '17 at 9:58

























        answered Jul 20 '17 at 9:32









        Nagaraju KasaNagaraju Kasa

        2,80621742




        2,80621742



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f184582%2fcustom-attribute-custom-attribute-to-quote-order-table-save-from-controller%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

            Fil:Tokke komm.svg

            Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?