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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user