diff --git a/classes/Address.php b/classes/Address.php index afd5df5ba..53a759500 100644 --- a/classes/Address.php +++ b/classes/Address.php @@ -180,7 +180,7 @@ class AddressCore extends ObjectModel { // for customer address we need to check of customer address already exists. if ($this->id_customer) { - if ($id_address = Customer::getCustomerIdAddress($this->id_customer)) { + if ($id_address = Customer::getCustomerIdAddress($this->id_customer, false)) { return false; } } diff --git a/classes/Customer.php b/classes/Customer.php index d67be88db..e3e0fd39d 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -465,10 +465,10 @@ class CustomerCore extends ObjectModel return Cache::retrieve($cache_id); } - public static function getCustomerIdAddress($id_customer) + public static function getCustomerIdAddress($id_customer, $use_cache = true) { $cache_id = 'Customer::getCustomerIdAddress'.(int)$id_customer; - if (!Cache::isStored($cache_id)) { + if (!$use_cache || !Cache::isStored($cache_id)) { $sql = 'SELECT id_address FROM `'._DB_PREFIX_.'address` a WHERE `id_customer` = '.(int)$id_customer.' AND a.`deleted` = 0';