Changeset View
Changeset View
Standalone View
Standalone View
modules/in-commerce/units/shipping_quote_engines/usps.php
Show First 20 Lines • Show All 700 Lines • ▼ Show 20 Line(s) | |||||
if (isset($this->service)) { | if (isset($this->service)) { | ||||
$this->types = array($this->service => $this->types[$this->service]); | $this->types = array($this->service => $this->types[$this->service]); | ||||
} | } | ||||
$dest_zip = str_replace(' ', '', $this->order['ShippingZip']); | $dest_zip = str_replace(' ', '', $this->order['ShippingZip']); | ||||
$dest_zip = substr($dest_zip, 0, 5); | $dest_zip = substr($dest_zip, 0, 5); | ||||
reset($this->types); | reset($this->types); | ||||
$allowed_types = explode(", ", MODULE_SHIPPING_USPS_TYPES); | $allowed_types = explode(", ", MODULE_SHIPPING_USPS_TYPES); | ||||
while (list($key, $value) = each($this->types)) | foreach ( array_keys($this->types) as $key ) { | ||||
{ | |||||
if ( !in_array($key, $allowed_types) ) continue; | if ( !in_array($key, $allowed_types) ) continue; | ||||
Lint: Generic.ControlStructures.InlineControlStructure.NotAllowed: Inline control structures are not allowed | |||||
Tabs must be used to indent lines; spaces are not allowed Lint: Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed: Tabs must be used to indent lines; spaces are not allowed | |||||
$request .= '<Package ID="'.$services_count.'">'. | $request .= '<Package ID="'.$services_count.'">'. | ||||
'<Service>'.$key.'</Service>'. | '<Service>'.$key.'</Service>'. | ||||
'<ZipOrigination>'.$this->store_zip5.'</ZipOrigination>'. | '<ZipOrigination>'.$this->store_zip5.'</ZipOrigination>'. | ||||
'<ZipDestination>'.$dest_zip.'</ZipDestination>'. | '<ZipDestination>'.$dest_zip.'</ZipDestination>'. | ||||
'<Pounds>'.$this->pounds.'</Pounds>'. | '<Pounds>'.$this->pounds.'</Pounds>'. | ||||
'<Ounces>'.$this->ounces.'</Ounces>'. | '<Ounces>'.$this->ounces.'</Ounces>'. | ||||
'<Size>'.$this->size.'</Size>'. | '<Size>'.$this->size.'</Size>'. | ||||
'<Machinable>'.$this->machinable.'</Machinable>'. | '<Machinable>'.$this->machinable.'</Machinable>'. | ||||
'</Package>'; | '</Package>'; | ||||
$services_count++; | $services_count++; | ||||
} | } | ||||
$request .= '</RateV3Request>'; | $request .= '</RateV3Request>'; | ||||
$api_query = 'RateV3'; | $api_query = 'RateV3'; | ||||
} | } | ||||
else { | else { | ||||
$request = '<IntlRateRequest USERID="'.$this->usps_userid.'">'. | $request = '<IntlRateRequest USERID="'.$this->usps_userid.'">'. | ||||
'<Package ID="0">'. | '<Package ID="0">'. | ||||
'<Pounds>'.$this->pounds.'</Pounds>'. | '<Pounds>'.$this->pounds.'</Pounds>'. | ||||
'<Ounces>'.$this->ounces.'</Ounces>'. | '<Ounces>'.$this->ounces.'</Ounces>'. | ||||
▲ Show 20 Lines • Show All 602 Lines • ▼ Show 20 Line(s) | |||||
if (file_exists($full_path)) { | if (file_exists($full_path)) { | ||||
unlink($full_path); | unlink($full_path); | ||||
} | } | ||||
} | } | ||||
return $usps_data; | return $usps_data; | ||||
} | } | ||||
} | } | ||||
No newline at end of file |
Inline control structures are not allowed