Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/units/shipping_quote_engines/shipping_quote_collector.php
Show All 13 Lines | |||||
defined('FULL_PATH') or die('restricted access!'); | defined('FULL_PATH') or die('restricted access!'); | ||||
class ShippingQuoteCollector extends ShippingQuoteEngine { | class ShippingQuoteCollector extends ShippingQuoteEngine { | ||||
function GetShippingQuotes($params) | function GetShippingQuotes($params) | ||||
{ | { | ||||
/** @var kCountryStatesHelper $cs_helper */ | /** @var kCountryStatesHelper $cs_helper */ | ||||
$cs_helper = $this->Application->recallObject('CountryStatesHelper'); | $cs_helper = $this->Application->recallObject('CountryStatesHelper'); | ||||
$has_states = $cs_helper->CountryHasStates($params['dest_country']); | |||||
$has_states = $cs_helper->CountryHasStates( $cs_helper->getCountryIso($params['dest_country'], true) ); | |||||
if ( | if ( | ||||
!$params['dest_city'] || !$params['dest_country'] || | !$params['dest_city'] || !$params['dest_country'] || | ||||
($has_states && !$params['dest_state']) || | ($has_states && !$params['dest_state']) || | ||||
!$params['dest_postal'] || !$params['packages'] | !$params['dest_postal'] || !$params['packages'] | ||||
) { | ) { | ||||
return Array (); | return Array (); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Line(s) | |||||
function price_sort($elem1, $elem2) | function price_sort($elem1, $elem2) | ||||
{ | { | ||||
if ($elem1['TotalCost'] == $elem2['TotalCost']) { | if ($elem1['TotalCost'] == $elem2['TotalCost']) { | ||||
return 0; | return 0; | ||||
} | } | ||||
return $elem1['TotalCost'] < $elem2['TotalCost'] ? -1 : 1; | return $elem1['TotalCost'] < $elem2['TotalCost'] ? -1 : 1; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |