Hi
Want to start shipping internationally but 'Airmail' option under Royal Mail shipping does not appear to work.
All other options ie 2nd class mail, intl signed for, parcels etc are working
Code for Airmail below - is it missing anything - or am I missing something very simple?
Thanks for any suggestions
if ($this->config->get('royal_mail_airmail')) {
$cost = 0;
$countries = explode(',', 'AL,AD,AM,AT,AZ,BY,BE,BA,BG,HR,CY,CZ,DK,EE,FO,FI,FR,GE,DE,GI,GR,GL,HU,IS,IE,IT,KZ,KG,LV,LI,LT,LU,MK,MT,MD,MC,NL,NO,PL,PT,RO,RU,SM,SK,SI,ES,SE,CH,TJ,TR,TM,UA,UZ,VA');
if (in_array($address['iso_code_2'], $countries)) {
$rates = explode(',', '0.01:1.31,0.02:1.31,0.04:1.31,0.06:1.31,0.08:1.31,0.1:1.31,0.12:1.42,0.14:1.57,0.16:1.7,0.18:1.85,0.2:1.98,0.22');
} else {
$rates = explode(',', '0.02:1.82,0.02:1.82,0.04:1.82,0.06:1.82,0.08:1.82,0.1:1.82,0.12:2.1,0.14:2.38,0.16:2.65,0.18:2.93,0.2:3.2,0.22');
}
foreach ($rates as $rate) {
$data = explode(':', $rate);
if ($data[0] >= $weight) {
if (isset($data[1])) {
$cost = $data[1];
}
break;
}
}
if ((float)$cost) {
$title = $this->language->get('text_airmail');
if ($this->config->get('royal_mail_display_weight')) {
$title .= ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class')) . ')';
}
if ($this->config->get('royal_mail_display_time')) {
$title .= ' (' . $this->language->get('text_eta') . ')';
}
$quote_data['airmail'] = array(
'id' => 'royal_mail.airmail',
'title' => $title,
'cost' => $cost,
'tax_class_id' => $this->config->get('royal_mail_tax_class_id'),
'text' => $this->currency->format($this->tax->calculate($cost, $this->config->get('royal_mail_tax_class_id'), $this->config->get('config_tax')))
);
}
}
Who is online
Users browsing this forum: No registered users and 3 guests