sohelrana09 / magento2-module-delivery-date

Order Delivery date extension will allow customer to choose preferable delivery date for order.
71 stars 61 forks source link

rest API support #7

Open anas-shehadeh opened 6 years ago

anas-shehadeh commented 6 years ago

can you add api support ?

moinmalek17 commented 5 years ago

Hi,

Please try below links where I passed the delivery date in API.

Edit the events.xml file on global state SR/DeliveryDate/etc/events.xml

`<?xml version="1.0" encoding="UTF-8"?>

` Then edit the `SR/DeliveryDate/etc/extension_attributes.xml` ` ` And After that create a observer file `SR\DeliveryDate\Observer\Sales\OrderLoadAfter.php` to get the delivery date. `getOrder(); $extensionAttributes = $order->getExtensionAttributes(); if ($extensionAttributes === null) { $extensionAttributes = $this->getOrderExtensionDependency(); } $attr = $order->getData('delivery_date'); $extensionAttributes->setDeliveryDate($attr); $order->setExtensionAttributes($extensionAttributes); } private function getOrderExtensionDependency() { $orderExtension = \Magento\Framework\App\ObjectManager::getInstance()->get( '\Magento\Sales\Api\Data\OrderExtension' ); return $orderExtension; } }`
moinmalek17 commented 5 years ago

Hi @anas-shehadeh

You can check the my repo on github https://github.com/moinmalek17/magento2-module-delivery-date-with-api

Thanks

malafalx91 commented 4 years ago

have API been added?

moinmalek17 commented 4 years ago

Hi @malafalx91 ,

Please check below link for that https://github.com/moinmalek17/magento2-module-delivery-date-with-api.

Thanks

malafalx91 commented 4 years ago

@moinmalek17 I installed your module, I tried to do this GET: http: // mysite / rest / V1 / orders / 2 but I don't find any reference to the delivery field. Can you tell me what GET I have to do?