Closed pbaum83 closed 2 years ago
Hi @pbaum83 ,
Here's a link to a document in our KB which mentions the following function you can use to do this: https://docs.shipperhq.com/integrate-shipperhq-order-management-fulfillment-service-magento/#Magento_2
The function getOrderCarrierGroupInfo($orderId) will output the pieces of data from that array included in the attached screenshot. This function can be found in “ShipperHQ\Shipper\Helper\CarrierGroup”.
For example for the delivery date you should be able to use the following piece of code: $carrierGroupInfo = $this->carrierGroupHelper->getOrderCarrierGroupInfo($order->getId()); $deliveryDate = $carrierGroupInfo['deivery_date'];
Thank you for the update! Much Appreciated.
Just in case anyone else uses this helper the return was an array when I implemented this code:
`$carrierGroupInfo = $this->carrierGroupHelper->getOrderCarrierGroupInfo($order->getId());
if (isset($carrierGroupInfo[0]['delivery_date']) === true) { $deliveryDate = $carrierGroupInfo[0]['delivery_date']; }`
What is the best way to pull the delivery/dispatch date from an order with the shipperhq module installed? Are there are any magic methods on the order interface or is helper that ships with the module to help with this? We have been using a SQL call to pull the values from the shipperhq_order_detail table which isn't ideal.