Convert from quote item to order item is not working
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
add a comment |
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
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 allvar/generation
andvar/di
and cache. and as @David Verholen said, debug your data there.
– MauroNigrele
Feb 10 '16 at 6:30
add a comment |
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
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
magento2 fieldsets
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 allvar/generation
andvar/di
and cache. and as @David Verholen said, debug your data there.
– MauroNigrele
Feb 10 '16 at 6:30
add a comment |
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 allvar/generation
andvar/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
add a comment |
4 Answers
4
active
oldest
votes
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'
}
}
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
add a comment |
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
add a comment |
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());
}
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
add a comment |
On your fieldset, try this:
<fieldset id="sales_convert_quote_item">
instead of what you currently have:
<fieldset id="convert_quote_item">
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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'
}
}
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
add a comment |
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'
}
}
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
add a comment |
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'
}
}
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'
}
}
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
add a comment |
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
add a comment |
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
add a comment |
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
add a comment |
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
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
edited yesterday
Himanshu
704419
704419
answered Feb 8 '16 at 13:48
David Verholen
5,23611130
5,23611130
add a comment |
add a comment |
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());
}
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
add a comment |
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());
}
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
add a comment |
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());
}
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());
}
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
add a comment |
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
add a comment |
On your fieldset, try this:
<fieldset id="sales_convert_quote_item">
instead of what you currently have:
<fieldset id="convert_quote_item">
add a comment |
On your fieldset, try this:
<fieldset id="sales_convert_quote_item">
instead of what you currently have:
<fieldset id="convert_quote_item">
add a comment |
On your fieldset, try this:
<fieldset id="sales_convert_quote_item">
instead of what you currently have:
<fieldset id="convert_quote_item">
On your fieldset, try this:
<fieldset id="sales_convert_quote_item">
instead of what you currently have:
<fieldset id="convert_quote_item">
answered Feb 14 '16 at 15:52
TJ Gamble at Jamersan
1,18658
1,18658
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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
andvar/di
and cache. and as @David Verholen said, debug your data there.– MauroNigrele
Feb 10 '16 at 6:30