Merge branch 'ticket-ChangeDeliveryAddress' into develop

This commit is contained in:
Marion Muszynski 2016-11-08 16:10:16 +01:00
commit ad9113aed1
2 changed files with 16 additions and 1 deletions

View File

@ -55,6 +55,20 @@ class Ant_Changeaddress extends Module
return $current_address;
}
public function getAddresses($id_customer, $id_country, $id_lang)
{
return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
SELECT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso
FROM `'._DB_PREFIX_.'address` a
LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`)
LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`)
WHERE `id_lang` = '.(int)($id_lang).'
AND `id_customer` = '.(int)($id_customer).'
AND a.`deleted` = 0
AND c.`id_country` = '.(int)($id_country));
}
public $validation = array(
'company' => '/[<>=#{}]*/',
'firstname' => '/[0-9!<>,;?=+()@#"°{}_$%:]*/',

View File

@ -161,9 +161,10 @@ if ($cookie->isLogged()) {
$current_address = $ant_changeaddress->getAddress($order->id_address_delivery);
$current_delivery = new Address((int)$order->id_address_delivery);
$smarty->assign(array(
'current_address' => $current_address,
'addresses' => $customer->getAddresses((int)$cookie->id_lang)
'addresses' => $ant_changeaddress->getAddresses((int)$customer->id,(int)$current_delivery->id_country,(int)$cookie->id_lang)
));
$smarty->assign(array(