Convert from quote item to order item is not working












5














There is custom field in quote_item table same as sales_order_item both column name and type are same.



I want to convert quote_item table to sales_order_item table. so I have used fieldset.xml to convert those data,



my fieldset.xml file is,



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
<fieldset id="quote_convert_item">
<field name="customcolumn1">
<aspect name="to_order_item" />
</field>
<field name="customcolumn2">
<aspect name="to_order_item" />
</field>
</fieldset>
</scope>
</config>


but its not working so strange










share|improve this question
























  • Please clear all cache & rebuild all indexing. after try again. :)
    – Abdul
    Feb 8 '16 at 6:51










  • Have you investigated log files, any error messages?
    – Arkadii Chyzhov
    Feb 8 '16 at 12:37










  • yes i checked log files no error message
    – Newbie
    Feb 8 '16 at 12:39










  • That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
    – MauroNigrele
    Feb 10 '16 at 6:30
















5














There is custom field in quote_item table same as sales_order_item both column name and type are same.



I want to convert quote_item table to sales_order_item table. so I have used fieldset.xml to convert those data,



my fieldset.xml file is,



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
<fieldset id="quote_convert_item">
<field name="customcolumn1">
<aspect name="to_order_item" />
</field>
<field name="customcolumn2">
<aspect name="to_order_item" />
</field>
</fieldset>
</scope>
</config>


but its not working so strange










share|improve this question
























  • Please clear all cache & rebuild all indexing. after try again. :)
    – Abdul
    Feb 8 '16 at 6:51










  • Have you investigated log files, any error messages?
    – Arkadii Chyzhov
    Feb 8 '16 at 12:37










  • yes i checked log files no error message
    – Newbie
    Feb 8 '16 at 12:39










  • That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
    – MauroNigrele
    Feb 10 '16 at 6:30














5












5








5


3





There is custom field in quote_item table same as sales_order_item both column name and type are same.



I want to convert quote_item table to sales_order_item table. so I have used fieldset.xml to convert those data,



my fieldset.xml file is,



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
<fieldset id="quote_convert_item">
<field name="customcolumn1">
<aspect name="to_order_item" />
</field>
<field name="customcolumn2">
<aspect name="to_order_item" />
</field>
</fieldset>
</scope>
</config>


but its not working so strange










share|improve this question















There is custom field in quote_item table same as sales_order_item both column name and type are same.



I want to convert quote_item table to sales_order_item table. so I have used fieldset.xml to convert those data,



my fieldset.xml file is,



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd">
<scope id="global">
<fieldset id="quote_convert_item">
<field name="customcolumn1">
<aspect name="to_order_item" />
</field>
<field name="customcolumn2">
<aspect name="to_order_item" />
</field>
</fieldset>
</scope>
</config>


but its not working so strange







magento2 fieldsets






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 8 '16 at 5:53









Rakesh Jesadiya

28.6k1571119




28.6k1571119










asked Feb 5 '16 at 7:31









Newbie

74921840




74921840












  • Please clear all cache & rebuild all indexing. after try again. :)
    – Abdul
    Feb 8 '16 at 6:51










  • Have you investigated log files, any error messages?
    – Arkadii Chyzhov
    Feb 8 '16 at 12:37










  • yes i checked log files no error message
    – Newbie
    Feb 8 '16 at 12:39










  • That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
    – MauroNigrele
    Feb 10 '16 at 6:30


















  • Please clear all cache & rebuild all indexing. after try again. :)
    – Abdul
    Feb 8 '16 at 6:51










  • Have you investigated log files, any error messages?
    – Arkadii Chyzhov
    Feb 8 '16 at 12:37










  • yes i checked log files no error message
    – Newbie
    Feb 8 '16 at 12:39










  • That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
    – MauroNigrele
    Feb 10 '16 at 6:30
















Please clear all cache & rebuild all indexing. after try again. :)
– Abdul
Feb 8 '16 at 6:51




Please clear all cache & rebuild all indexing. after try again. :)
– Abdul
Feb 8 '16 at 6:51












Have you investigated log files, any error messages?
– Arkadii Chyzhov
Feb 8 '16 at 12:37




Have you investigated log files, any error messages?
– Arkadii Chyzhov
Feb 8 '16 at 12:37












yes i checked log files no error message
– Newbie
Feb 8 '16 at 12:39




yes i checked log files no error message
– Newbie
Feb 8 '16 at 12:39












That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
– MauroNigrele
Feb 10 '16 at 6:30




That configuration should be enough try to clean all var/generation and var/di and cache. and as @David Verholen said, debug your data there.
– MauroNigrele
Feb 10 '16 at 6:30










4 Answers
4






active

oldest

votes


















13














In Magento 2 without using fieldset you can also copy custom data from quote item to order item by using plugin.



create di.xml in your module etc folder.



app/code/Vender/Yourmodule/etc/di.xml



<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="MagentoQuoteModelQuoteItemToOrderItem">
       <plugin name="cedapi_quote_to_order_item" type="VenderYourmoduleModelPluginQuoteQuoteToOrderItem"/>
   </type>
</config>


Create a class to your module and define a function. app/code/Vender/Yourmodule/Model/Plugin/Quote

Create QuoteToOrderItem.php file



<?php
namespace VenderYourmoduleModelPluginQuote;

use Closure;

class QuoteToOrderItem
{
/**
* @param MagentoQuoteModelQuoteItemToOrderItem $subject
* @param callable $proceed
* @param MagentoQuoteModelQuoteItemAbstractItem $item
* @param array $additional
* @return MagentoSalesModelOrderItem
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function aroundConvert(
MagentoQuoteModelQuoteItemToOrderItem $subject,
Closure $proceed,
MagentoQuoteModelQuoteItemAbstractItem $item,
$additional =
) {
/** @var $orderItem MagentoSalesModelOrderItem */
$orderItem = $proceed($item, $additional);//result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
$orderItem->setCustomDesign($item->getCustomDesign());//set your required
return $orderItem;// return an object '$orderItem' which will replace result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
}

}





share|improve this answer



















  • 1




    +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
    – Rakesh Jesadiya
    Sep 21 '16 at 12:31










  • I tried with some more data. It is not working.
    – Saravanan DS
    Sep 7 '18 at 6:50



















1














I think the converting is done here: https://github.com/magento/magento2/blob/2.0/app/code/Magento/Quote/Model/Quote/Item/ToOrderItem.php#L61



you may want to debug here and see what happens



UPDATE



had the same problem today. It seems to be a bug since the converting itself seems to work, but the populeateWithArray then strips the new attribute.



I solved it with an around plugin on the ToOrderItem class like described here






share|improve this answer































    0














    Try to create observer of sales_model_service_quote_submit_before and there get the object of order using $order=$observer->getOrder(); and set your values on that order object.
    it will solve your problem.



    ==== Update======


    create events.xml and put the following code



    <?xml version="1.0" encoding="UTF-8"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
    <event name="sales_model_service_quote_submit_before">
    <observer name="event_name" instance="CompanynamePackagenameObserverObservername" />
    </event>
    </config>




    now create observer file Observername.php add this code



    public function execute(MagentoFrameworkEventObserver $observer)
    {
    $quote=$observer->getQuote();
    $order=$observer->getOrder();
    $order->setCustomcolumn1($quote->getCustomcolumn1());
    $order->setCustomcolumn2($quote->getCustomcolumn2());
    }





    share|improve this answer























    • Here we are talking about quoteItem to orderItem not quote to order
      – MagePsycho
      Oct 12 '17 at 9:31










    • I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
      – Magecode
      Jun 14 '18 at 11:49












    • In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
      – Magecode
      Jun 14 '18 at 12:12



















    0














    On your fieldset, try this:



    <fieldset id="sales_convert_quote_item">


    instead of what you currently have:



    <fieldset id="convert_quote_item">





    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%2f100463%2fconvert-from-quote-item-to-order-item-is-not-working%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      13














      In Magento 2 without using fieldset you can also copy custom data from quote item to order item by using plugin.



      create di.xml in your module etc folder.



      app/code/Vender/Yourmodule/etc/di.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <type name="MagentoQuoteModelQuoteItemToOrderItem">
             <plugin name="cedapi_quote_to_order_item" type="VenderYourmoduleModelPluginQuoteQuoteToOrderItem"/>
         </type>
      </config>


      Create a class to your module and define a function. app/code/Vender/Yourmodule/Model/Plugin/Quote

      Create QuoteToOrderItem.php file



      <?php
      namespace VenderYourmoduleModelPluginQuote;

      use Closure;

      class QuoteToOrderItem
      {
      /**
      * @param MagentoQuoteModelQuoteItemToOrderItem $subject
      * @param callable $proceed
      * @param MagentoQuoteModelQuoteItemAbstractItem $item
      * @param array $additional
      * @return MagentoSalesModelOrderItem
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
      public function aroundConvert(
      MagentoQuoteModelQuoteItemToOrderItem $subject,
      Closure $proceed,
      MagentoQuoteModelQuoteItemAbstractItem $item,
      $additional =
      ) {
      /** @var $orderItem MagentoSalesModelOrderItem */
      $orderItem = $proceed($item, $additional);//result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      $orderItem->setCustomDesign($item->getCustomDesign());//set your required
      return $orderItem;// return an object '$orderItem' which will replace result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      }

      }





      share|improve this answer



















      • 1




        +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
        – Rakesh Jesadiya
        Sep 21 '16 at 12:31










      • I tried with some more data. It is not working.
        – Saravanan DS
        Sep 7 '18 at 6:50
















      13














      In Magento 2 without using fieldset you can also copy custom data from quote item to order item by using plugin.



      create di.xml in your module etc folder.



      app/code/Vender/Yourmodule/etc/di.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <type name="MagentoQuoteModelQuoteItemToOrderItem">
             <plugin name="cedapi_quote_to_order_item" type="VenderYourmoduleModelPluginQuoteQuoteToOrderItem"/>
         </type>
      </config>


      Create a class to your module and define a function. app/code/Vender/Yourmodule/Model/Plugin/Quote

      Create QuoteToOrderItem.php file



      <?php
      namespace VenderYourmoduleModelPluginQuote;

      use Closure;

      class QuoteToOrderItem
      {
      /**
      * @param MagentoQuoteModelQuoteItemToOrderItem $subject
      * @param callable $proceed
      * @param MagentoQuoteModelQuoteItemAbstractItem $item
      * @param array $additional
      * @return MagentoSalesModelOrderItem
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
      public function aroundConvert(
      MagentoQuoteModelQuoteItemToOrderItem $subject,
      Closure $proceed,
      MagentoQuoteModelQuoteItemAbstractItem $item,
      $additional =
      ) {
      /** @var $orderItem MagentoSalesModelOrderItem */
      $orderItem = $proceed($item, $additional);//result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      $orderItem->setCustomDesign($item->getCustomDesign());//set your required
      return $orderItem;// return an object '$orderItem' which will replace result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      }

      }





      share|improve this answer



















      • 1




        +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
        – Rakesh Jesadiya
        Sep 21 '16 at 12:31










      • I tried with some more data. It is not working.
        – Saravanan DS
        Sep 7 '18 at 6:50














      13












      13








      13






      In Magento 2 without using fieldset you can also copy custom data from quote item to order item by using plugin.



      create di.xml in your module etc folder.



      app/code/Vender/Yourmodule/etc/di.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <type name="MagentoQuoteModelQuoteItemToOrderItem">
             <plugin name="cedapi_quote_to_order_item" type="VenderYourmoduleModelPluginQuoteQuoteToOrderItem"/>
         </type>
      </config>


      Create a class to your module and define a function. app/code/Vender/Yourmodule/Model/Plugin/Quote

      Create QuoteToOrderItem.php file



      <?php
      namespace VenderYourmoduleModelPluginQuote;

      use Closure;

      class QuoteToOrderItem
      {
      /**
      * @param MagentoQuoteModelQuoteItemToOrderItem $subject
      * @param callable $proceed
      * @param MagentoQuoteModelQuoteItemAbstractItem $item
      * @param array $additional
      * @return MagentoSalesModelOrderItem
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
      public function aroundConvert(
      MagentoQuoteModelQuoteItemToOrderItem $subject,
      Closure $proceed,
      MagentoQuoteModelQuoteItemAbstractItem $item,
      $additional =
      ) {
      /** @var $orderItem MagentoSalesModelOrderItem */
      $orderItem = $proceed($item, $additional);//result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      $orderItem->setCustomDesign($item->getCustomDesign());//set your required
      return $orderItem;// return an object '$orderItem' which will replace result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      }

      }





      share|improve this answer














      In Magento 2 without using fieldset you can also copy custom data from quote item to order item by using plugin.



      create di.xml in your module etc folder.



      app/code/Vender/Yourmodule/etc/di.xml



      <?xml version="1.0"?>
      <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
      <type name="MagentoQuoteModelQuoteItemToOrderItem">
             <plugin name="cedapi_quote_to_order_item" type="VenderYourmoduleModelPluginQuoteQuoteToOrderItem"/>
         </type>
      </config>


      Create a class to your module and define a function. app/code/Vender/Yourmodule/Model/Plugin/Quote

      Create QuoteToOrderItem.php file



      <?php
      namespace VenderYourmoduleModelPluginQuote;

      use Closure;

      class QuoteToOrderItem
      {
      /**
      * @param MagentoQuoteModelQuoteItemToOrderItem $subject
      * @param callable $proceed
      * @param MagentoQuoteModelQuoteItemAbstractItem $item
      * @param array $additional
      * @return MagentoSalesModelOrderItem
      * @SuppressWarnings(PHPMD.UnusedFormalParameter)
      */
      public function aroundConvert(
      MagentoQuoteModelQuoteItemToOrderItem $subject,
      Closure $proceed,
      MagentoQuoteModelQuoteItemAbstractItem $item,
      $additional =
      ) {
      /** @var $orderItem MagentoSalesModelOrderItem */
      $orderItem = $proceed($item, $additional);//result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      $orderItem->setCustomDesign($item->getCustomDesign());//set your required
      return $orderItem;// return an object '$orderItem' which will replace result of function 'convert' in class 'MagentoQuoteModelQuoteItemToOrderItem'
      }

      }






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 6 '16 at 20:48









      Khoa TruongDinh

      20.9k63884




      20.9k63884










      answered Aug 6 '16 at 13:48









      Jitendra Mohanta

      474315




      474315








      • 1




        +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
        – Rakesh Jesadiya
        Sep 21 '16 at 12:31










      • I tried with some more data. It is not working.
        – Saravanan DS
        Sep 7 '18 at 6:50














      • 1




        +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
        – Rakesh Jesadiya
        Sep 21 '16 at 12:31










      • I tried with some more data. It is not working.
        – Saravanan DS
        Sep 7 '18 at 6:50








      1




      1




      +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
      – Rakesh Jesadiya
      Sep 21 '16 at 12:31




      +1, This is working fine for quote to sales_order_item. Could you please show how to convert sales_order_item to sales_invoice_item?
      – Rakesh Jesadiya
      Sep 21 '16 at 12:31












      I tried with some more data. It is not working.
      – Saravanan DS
      Sep 7 '18 at 6:50




      I tried with some more data. It is not working.
      – Saravanan DS
      Sep 7 '18 at 6:50













      1














      I think the converting is done here: https://github.com/magento/magento2/blob/2.0/app/code/Magento/Quote/Model/Quote/Item/ToOrderItem.php#L61



      you may want to debug here and see what happens



      UPDATE



      had the same problem today. It seems to be a bug since the converting itself seems to work, but the populeateWithArray then strips the new attribute.



      I solved it with an around plugin on the ToOrderItem class like described here






      share|improve this answer




























        1














        I think the converting is done here: https://github.com/magento/magento2/blob/2.0/app/code/Magento/Quote/Model/Quote/Item/ToOrderItem.php#L61



        you may want to debug here and see what happens



        UPDATE



        had the same problem today. It seems to be a bug since the converting itself seems to work, but the populeateWithArray then strips the new attribute.



        I solved it with an around plugin on the ToOrderItem class like described here






        share|improve this answer


























          1












          1








          1






          I think the converting is done here: https://github.com/magento/magento2/blob/2.0/app/code/Magento/Quote/Model/Quote/Item/ToOrderItem.php#L61



          you may want to debug here and see what happens



          UPDATE



          had the same problem today. It seems to be a bug since the converting itself seems to work, but the populeateWithArray then strips the new attribute.



          I solved it with an around plugin on the ToOrderItem class like described here






          share|improve this answer














          I think the converting is done here: https://github.com/magento/magento2/blob/2.0/app/code/Magento/Quote/Model/Quote/Item/ToOrderItem.php#L61



          you may want to debug here and see what happens



          UPDATE



          had the same problem today. It seems to be a bug since the converting itself seems to work, but the populeateWithArray then strips the new attribute.



          I solved it with an around plugin on the ToOrderItem class like described here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited yesterday









          Himanshu

          704419




          704419










          answered Feb 8 '16 at 13:48









          David Verholen

          5,23611130




          5,23611130























              0














              Try to create observer of sales_model_service_quote_submit_before and there get the object of order using $order=$observer->getOrder(); and set your values on that order object.
              it will solve your problem.



              ==== Update======


              create events.xml and put the following code



              <?xml version="1.0" encoding="UTF-8"?>
              <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
              <event name="sales_model_service_quote_submit_before">
              <observer name="event_name" instance="CompanynamePackagenameObserverObservername" />
              </event>
              </config>




              now create observer file Observername.php add this code



              public function execute(MagentoFrameworkEventObserver $observer)
              {
              $quote=$observer->getQuote();
              $order=$observer->getOrder();
              $order->setCustomcolumn1($quote->getCustomcolumn1());
              $order->setCustomcolumn2($quote->getCustomcolumn2());
              }





              share|improve this answer























              • Here we are talking about quoteItem to orderItem not quote to order
                – MagePsycho
                Oct 12 '17 at 9:31










              • I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
                – Magecode
                Jun 14 '18 at 11:49












              • In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
                – Magecode
                Jun 14 '18 at 12:12
















              0














              Try to create observer of sales_model_service_quote_submit_before and there get the object of order using $order=$observer->getOrder(); and set your values on that order object.
              it will solve your problem.



              ==== Update======


              create events.xml and put the following code



              <?xml version="1.0" encoding="UTF-8"?>
              <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
              <event name="sales_model_service_quote_submit_before">
              <observer name="event_name" instance="CompanynamePackagenameObserverObservername" />
              </event>
              </config>




              now create observer file Observername.php add this code



              public function execute(MagentoFrameworkEventObserver $observer)
              {
              $quote=$observer->getQuote();
              $order=$observer->getOrder();
              $order->setCustomcolumn1($quote->getCustomcolumn1());
              $order->setCustomcolumn2($quote->getCustomcolumn2());
              }





              share|improve this answer























              • Here we are talking about quoteItem to orderItem not quote to order
                – MagePsycho
                Oct 12 '17 at 9:31










              • I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
                – Magecode
                Jun 14 '18 at 11:49












              • In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
                – Magecode
                Jun 14 '18 at 12:12














              0












              0








              0






              Try to create observer of sales_model_service_quote_submit_before and there get the object of order using $order=$observer->getOrder(); and set your values on that order object.
              it will solve your problem.



              ==== Update======


              create events.xml and put the following code



              <?xml version="1.0" encoding="UTF-8"?>
              <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
              <event name="sales_model_service_quote_submit_before">
              <observer name="event_name" instance="CompanynamePackagenameObserverObservername" />
              </event>
              </config>




              now create observer file Observername.php add this code



              public function execute(MagentoFrameworkEventObserver $observer)
              {
              $quote=$observer->getQuote();
              $order=$observer->getOrder();
              $order->setCustomcolumn1($quote->getCustomcolumn1());
              $order->setCustomcolumn2($quote->getCustomcolumn2());
              }





              share|improve this answer














              Try to create observer of sales_model_service_quote_submit_before and there get the object of order using $order=$observer->getOrder(); and set your values on that order object.
              it will solve your problem.



              ==== Update======


              create events.xml and put the following code



              <?xml version="1.0" encoding="UTF-8"?>
              <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/Event/etc/events.xsd">
              <event name="sales_model_service_quote_submit_before">
              <observer name="event_name" instance="CompanynamePackagenameObserverObservername" />
              </event>
              </config>




              now create observer file Observername.php add this code



              public function execute(MagentoFrameworkEventObserver $observer)
              {
              $quote=$observer->getQuote();
              $order=$observer->getOrder();
              $order->setCustomcolumn1($quote->getCustomcolumn1());
              $order->setCustomcolumn2($quote->getCustomcolumn2());
              }






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Feb 8 '16 at 13:49

























              answered Feb 8 '16 at 13:28









              Emipro Technologies Pvt. Ltd.

              2,4491823




              2,4491823












              • Here we are talking about quoteItem to orderItem not quote to order
                – MagePsycho
                Oct 12 '17 at 9:31










              • I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
                – Magecode
                Jun 14 '18 at 11:49












              • In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
                – Magecode
                Jun 14 '18 at 12:12


















              • Here we are talking about quoteItem to orderItem not quote to order
                – MagePsycho
                Oct 12 '17 at 9:31










              • I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
                – Magecode
                Jun 14 '18 at 11:49












              • In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
                – Magecode
                Jun 14 '18 at 12:12
















              Here we are talking about quoteItem to orderItem not quote to order
              – MagePsycho
              Oct 12 '17 at 9:31




              Here we are talking about quoteItem to orderItem not quote to order
              – MagePsycho
              Oct 12 '17 at 9:31












              I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
              – Magecode
              Jun 14 '18 at 11:49






              I have added comment field after payment methods and before apply discount. I have added the custom column to quote and sales_order. I am using this event observer code to get comment data but not getting comment field data. please help me.
              – Magecode
              Jun 14 '18 at 11:49














              In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
              – Magecode
              Jun 14 '18 at 12:12




              In quote I am not getting data of custom field which i have added in Review & payment step after Payment Method
              – Magecode
              Jun 14 '18 at 12:12











              0














              On your fieldset, try this:



              <fieldset id="sales_convert_quote_item">


              instead of what you currently have:



              <fieldset id="convert_quote_item">





              share|improve this answer


























                0














                On your fieldset, try this:



                <fieldset id="sales_convert_quote_item">


                instead of what you currently have:



                <fieldset id="convert_quote_item">





                share|improve this answer
























                  0












                  0








                  0






                  On your fieldset, try this:



                  <fieldset id="sales_convert_quote_item">


                  instead of what you currently have:



                  <fieldset id="convert_quote_item">





                  share|improve this answer












                  On your fieldset, try this:



                  <fieldset id="sales_convert_quote_item">


                  instead of what you currently have:



                  <fieldset id="convert_quote_item">






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 14 '16 at 15:52









                  TJ Gamble at Jamersan

                  1,18658




                  1,18658






























                      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.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • 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%2f100463%2fconvert-from-quote-item-to-order-item-is-not-working%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

                      1300-talet

                      1300-talet

                      Display a custom attribute below product name in the front-end Magento 1.9.3.8