Advertisement
Guest User

Untitled

a guest
May 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2.  
  3. $customerAddressID = '24'; // your customer address id
  4. $customerID = '1';
  5. $customer = Mage::getModel('customer/customer')->load($customerID);
  6.  
  7. $defaultBilling = $customer->getDefaultBillingAddress();
  8. $defaultShipping = $customer->getDefaultShippingAddress();
  9.  
  10. if ( ! $defaultBilling ) {
  11. $def_billing = 0;
  12. } else {
  13. $def_billing = $defaultBilling->getData('entity_id');
  14. }
  15.  
  16. if ( ! $defaultShipping ) {
  17. $def_shipping = 0;
  18. } else {
  19. $def_shipping = $defaultShipping ->getData('entity_id');
  20. }
  21.  
  22. if(($customerAddressID == $def_billing) || ($customerAddressID == $def_shipping))
  23. {
  24. // your address is default billing or shipping address
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement