I'm trying to check if billing and shipping address are equal when creating invoice PDFs.
What I've tried so far was:
$order = $invoice->getOrder();
if( $order->getBillingAddress()->getData() != $order->getShippingAddress()->getData() )
or
$order = $invoice->getOrder();
if( $order->getShippingAddress()->getData('same_as_billing')!='1' )
but neither works. I was also trying to get the quote by using $order->getQuote()
but that didn't work either.
Is there any way to check if billing and shipping address are equal?
Best Answer
Use array_diff.
ref: http://us3.php.net/array_diff
you may have to strip out some of the data of each array, before the diff. I am sure you can work it out ;)