enter image description here

How do I get the example value which is the date.

$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();

these two don't have it

But it saves in quote_address table

  • If you get value from order then you need to add that fields in sales order table – Pradip Garchar Oct 18 '19 at 12:57
  • I tried that way but wasn't getting the value in that table it goes in sales_order_address – jibin george Oct 18 '19 at 13:03
  • $order->getShippingAddress()->getData('example'); OR $order->getShippingAddress()->getExample(); – Ranjeet Kumar Oct 18 '19 at 14:28

You need to add that fields in sales_order_address table

and then you can get values from order address object

for example

    $billingAddress = $order->getBillingAddress();
    $shippingAddress = $order->getShippingAddress();

get separate field as well :

    $billingcity = $order->getBillingAddress()->getCity();

same things you can get custom fields as well

  • It didnt work, i have the example in sales_order_address and i have the value saved but when i do $billingAddress = $order->getBillingAddress(); $shippingAddress = $order->getShippingAddress(); i dont see it its NULL – jibin george Oct 18 '19 at 13:04
  • have you check in table , value is there or null ? – Pradip Garchar Oct 18 '19 at 13:05
  • Sorry my bad, It saves in quote_address but its NULL in sales_order_address. I dont know how to get this value in toi sales_order_address – jibin george Oct 18 '19 at 13:08
  • you can use this for convert quote to slaes app/code/Vendor/Extension/etc/fieldset.xml <?xml version="1.0"?> <config xmlns:xsi="w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:DataObject/etc/fieldset.xsd"> <scope id="global"> <fieldset id="sales_convert_quote_address"> <field name="custom_module_table_id"> <aspect name="to_order"/> </field> </fieldset> </scope> </config> – Pradip Garchar Oct 18 '19 at 13:13
  • if have you useful then up-vote my answer – Pradip Garchar Oct 18 '19 at 13:14

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.