// Merge -> 8910
This commit is contained in:
+8
-8
@@ -35,7 +35,7 @@ class CarrierCore extends ObjectModel
|
||||
const CARRIERS_MODULE_NEED_RANGE = 3;
|
||||
const PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE = 4;
|
||||
const ALL_CARRIERS = 5;
|
||||
|
||||
|
||||
const SHIPPING_METHOD_DEFAULT = 0;
|
||||
const SHIPPING_METHOD_WEIGHT = 1;
|
||||
const SHIPPING_METHOD_PRICE = 2;
|
||||
@@ -412,23 +412,23 @@ class CarrierCore extends ObjectModel
|
||||
{
|
||||
if (!Validate::isBool($activeCountries) OR !Validate::isBool($activeCarriers))
|
||||
die(Tools::displayError());
|
||||
|
||||
|
||||
$states = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT s.*
|
||||
FROM `'._DB_PREFIX_.'state` s
|
||||
ORDER BY s.`name` ASC');
|
||||
|
||||
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
|
||||
SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone FROM `'._DB_PREFIX_.'country` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = 1)
|
||||
SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone FROM `'._DB_PREFIX_.'country` c
|
||||
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = 1)
|
||||
INNER JOIN (`'._DB_PREFIX_.'carrier_zone` cz INNER JOIN `'._DB_PREFIX_.'carrier` cr ON ( cr.id_carrier = cz.id_carrier AND cr.deleted = 0 '.($activeCarriers ?
|
||||
'AND cr.active = 1) ' : ') ').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'zone` zz ON cz.id_zone = zz.id_zone) ON zz.`id_zone` = c.`id_zone`
|
||||
LEFT JOIN `'._DB_PREFIX_.'zone` zz ON cz.id_zone = zz.id_zone) ON zz.`id_zone` = c.`id_zone`
|
||||
WHERE 1
|
||||
'.($activeCountries ? 'AND c.active = 1' : '').'
|
||||
'.(!is_null($containStates) ? 'AND c.`contains_states` = '.(int)($containStates) : '').'
|
||||
ORDER BY cl.name ASC');
|
||||
|
||||
|
||||
$countries = array();
|
||||
foreach ($result AS &$country)
|
||||
$countries[$country['id_country']] = $country;
|
||||
@@ -438,12 +438,12 @@ class CarrierCore extends ObjectModel
|
||||
|
||||
return $countries;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param int $id_zone
|
||||
* @param Array $groups group of the customer
|
||||
* @return Array
|
||||
* @return Array
|
||||
*/
|
||||
public static function getCarriersForOrder($id_zone, $groups = NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user