0

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

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

1 Answer 1

0

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

9
  • 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 Commented Oct 18, 2019 at 13:04
  • have you check in table , value is there or null ? Commented Oct 18, 2019 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 Commented Oct 18, 2019 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> Commented Oct 18, 2019 at 13:13
  • if have you useful then up-vote my answer Commented Oct 18, 2019 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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