/** * Check whether specified shipping address is default for its customer * * @param Address $address * @return bool */ protected function _isDefaultShipping($address) { return $address->getId() && $address->getId() == $address->getCustomer()->getDefaultShipping() || $address->getIsPrimaryShipping() || $address->getIsDefaultShipping(); }