---
title: "How to Convert the Custom Field from Quote item to Order item in Magento"
url: "https://magecomp.com/blog/how-to-convert-the-custom-field-from-quote-item-to-order-item-in-magento/"
date: "2019-08-16T17:33:21+00:00"
modified: "2025-02-21T09:21:08+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 390
reading_time: "2 min read"
summary: "In an Ecommerce store, every product has different shipping costs as well as other additional costs charged by your store owner. So, if the customer adds a product in his/her shopping cart the whol..."
description: "Magento stores every cart known as a persistent cart in backend with all added products bound in the one single quote item field. But if such cart is restore..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Get Instagram Client ID and Client Secret for Magento Instagram Extension"
    url: "https://magecomp.com/blog/get-instagram-client-id-client-secret-magento-instagram-extension/"
  - title: "How to remove custom options price from the dropdown in Magento 2"
    url: "https://magecomp.com/blog/remove-custom-options-price-dropdown-magento-2/"
  - title: "Magento 2: How to Delete Categories using Root Script by Category IDs"
    url: "https://magecomp.com/blog/magento-2-delete-categories-using-root-script-by-category-ids/"
---

# How to Convert the Custom Field from Quote item to Order item in Magento

_Published: August 16, 2019_  
_Author: Dhiren Vasoya_  

![Converting a custom field from quote item to order item in Magento 2](https://magecomp.com/blog/wp-content/uploads/2019/08/Converting-a-custom-field-from-quote-item-to-order-item-in-Magento-2-1024x332.webp)

In an Ecommerce store, every product has different shipping costs as well as other additional costs charged by your store owner. So, if the customer adds a product in his/her shopping cart the whole cart summary can be view in the shopping cart as well as while checkout. Also, Magento stores every cart is known as a persistent cart in the backend with all added products bound in the one single quote item field. But if such cart is restored, it will only restore selected products, not its extra charges or shipping. So, every time your customers need to reselect every option when they came back for checkout.

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2.webp)](https://magecomp.com/services/magento-upgrade-services/)
So to resolve such problem you need to create custom additional quote field in the backend which holds such values and reapplied charges on cart restoration. To do the same, simply follow below two steps to convert a custom field from quote item to order item in Magento
First, create “**di.xml**” file at the following path.
**app\code \Vendor \Extension\etc\**

```

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <type name="MagentoQuoteModelQuoteItemToOrderItem">
	<plugin name="quote_item_to_order_item"    type="VendorExtensionPluginQuoteConvertquoteitemtoorder"/>
</type>
 </config>

```

Now, we need to create one more file “Convertquoteitemtoorder.php” to convert quote item at this path.
**app\code\Vendor\Extension\Plugin\Quote\**

```

<?php
namespace VendorExtensionPluginQuote;
class Convertquoteitemtoorder{
	public function aroundConvert(
    	MagentoQuoteModelQuoteItemToOrderItem $subject,
    	Closure $proceed,
        MagentoQuoteModelQuoteItemAbstractItem $item,
    	$additional = []
	) {
    	$orderItem = $proceed($item, $additional);
        $orderItem->setCustomField1($item->getCustomField1());
        $orderItem->setCustomField2($item->getCustomField2());
        $orderItem->setCustomField3($item->getCustomField3());
    	return $orderItem;
	}
}
```

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2023/04/Magento-Malware-Removal-CTA-1.webp)](https://magecomp.com/magento-malware-removal.html)

That’s it, by following those 2 simple steps you can transfer all the Additional custom fields in the Quote field to the customer’s final order list. You are free add manipulate above code.

Lastly, if you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends and Let us know if you are facing any issue while implementing this code.

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-3.webp)](https://magecomp.com/magento-performance-optimization.html)

Happy Coding!


---

_View the original post at: [https://magecomp.com/blog/how-to-convert-the-custom-field-from-quote-item-to-order-item-in-magento/](https://magecomp.com/blog/how-to-convert-the-custom-field-from-quote-item-to-order-item-in-magento/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-07-30 20:01:41 UTC_  
