1

I have a custom delivery_date column in quote table which I want to pass to V1/orders , I have passed this in extension_attribute.xml as following ;

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="delivery_date" type="string"/>
    </extension_attributes>
</config>

After placing order I am able to see it get and set methods for the same in var/generation/Magento/Sales/Api/Data/OrderExtensionInterface.php but in API it is not there.

Are there any extra steps I need to follow.

Please Help.

0

You need to add this column to order table and map it in module.xml like this:

<virtualType name="Magento\Saled\Model\ResourceModel\Order"><arguments>
<argument name="columns" xsi:type="array">
<item name="delivery_date"xsi:type="string">sales_order.delivery_date</item>
</argument>
</arguments>
</virtualType>

and in di.xml add the module name in sequence :

<module name="Magento_Sales"/>
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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