0

I've been trying for hours to load the billing address from the sales_flat_order_address table then I would like to get the shipping address but for some reason the shipping loads first.

I'm using the parent_id to load the model and I'd expect the billing row to load first but it isn't. For some reason it skips over the billing address and loads the shipping data first then come back for the billing address after.

Does anyone know what I'm doing wrong here?

enter image description here

2 Answers 2

0

this is how you get the billing addess

$orderdata = Mage::getModel('sales/order')->load(212295);
$billingAddress = $orderdata->getBillingAddress();
$address=$billingAddress->getStreet();
echo $address[0];
1

I am not sure but if you have order object then why you are not getting address from directly by order object.

$order = Mage::getModel('sales/order')->load($orderId);
$billingAddress = $order->getBillingAddress();
$shippingAddress = $order->getShippingAddress();

It will also give you billing and shipping address of order.

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.