Skip to content

Commit c829ec5

Browse files
authored
Merge pull request #788 from abhishek-webkul/gli-1422
Fixed: Error when updating address from customer acccount which has been used to create an order at front office
2 parents 454b726 + 37e9262 commit c829ec5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

classes/Address.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function add($autodate = true, $null_values = false)
180180
{
181181
// for customer address we need to check of customer address already exists.
182182
if ($this->id_customer) {
183-
if ($id_address = Customer::getCustomerIdAddress($this->id_customer)) {
183+
if ($id_address = Customer::getCustomerIdAddress($this->id_customer, false)) {
184184
return false;
185185
}
186186
}

classes/Customer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ public function getAddresses($id_lang)
465465
return Cache::retrieve($cache_id);
466466
}
467467

468-
public static function getCustomerIdAddress($id_customer)
468+
public static function getCustomerIdAddress($id_customer, $use_cache = true)
469469
{
470470
$cache_id = 'Customer::getCustomerIdAddress'.(int)$id_customer;
471-
if (!Cache::isStored($cache_id)) {
471+
if (!$use_cache || !Cache::isStored($cache_id)) {
472472
$sql = 'SELECT id_address
473473
FROM `'._DB_PREFIX_.'address` a
474474
WHERE `id_customer` = '.(int)$id_customer.' AND a.`deleted` = 0';

0 commit comments

Comments
 (0)