Just a question about Royal Mail module.
I'm trying to setup the module for international signed for and first class recorded. I'm wanting the prices to correspond with the royal mail prices and to offer an option for compensation for international shipping if the total price goes over 500 pounds.
Thanks in advance for any help.
I'm trying to setup the module for international signed for and first class recorded. I'm wanting the prices to correspond with the royal mail prices and to offer an option for compensation for international shipping if the total price goes over 500 pounds.
Thanks in advance for any help.
The attached is for 1.5.0.5 but should work with other 1.5.x versions
catalog/model/shipping/
I think I added the international shipping insurance for over £500 when I updated the rates.
Try it and see.
BACKUP your old file first.
catalog/model/shipping/
I think I added the international shipping insurance for over £500 when I updated the rates.
Try it and see.
BACKUP your old file first.
Attachments
Cool thanks for the code, since first class recorded doesn't offer any compensation over 46 pounds, should i just copy and paste the code for first class recorded and create a new option for special delivery since this module doesn't offer it by default?
EDIT: Right so I've added in the code myself for the new option of Special Delivery. When I checkout with an account that is registered in GB the International Signed for option is displayed with a price, how do i get rid of that?
EDIT2: Sorry found an updated royal mail module. thanks
EDIT: Right so I've added in the code myself for the new option of Special Delivery. When I checkout with an account that is registered in GB the International Signed for option is displayed with a price, how do i get rid of that?
EDIT2: Sorry found an updated royal mail module. thanks
I think I found a bug, when Show Compensation is enabled, in the checkout it says
First Class Recorded Post (Weight: 5.35kg) £12.77
Special Next Day Delivery (Weight: 5.35kg) (Insured upto: £0.90) £22.70
for something that should be insured up to £500 and £0.90 added to the total of £22.70
First Class Recorded Post (Weight: 5.35kg) £12.77
Special Next Day Delivery (Weight: 5.35kg) (Insured upto: £0.90) £22.70
for something that should be insured up to £500 and £0.90 added to the total of £22.70
Special Delivery next Day is not in my file above
Where did you get the file from ?
Maybe you should ask them ?
Where did you get the file from ?
Maybe you should ask them ?
The Special Delivery was something I added myself, but i've updated the royal mail module to the revision r558 one just here http://code.google.com/p/opencart/source/detail?r=558. The insurance is still acting funny its showing up in the line as insured up to 0.90 p when it should be added to the total.
Code: Select all
$rates = explode(',', $this->config->get('royal_mail_special_delivery_500_insurance'));
foreach ($rates as $rate) {
$data = explode(':', $rate);
if ($data[0] >= $sub_total) {
if (isset($data[1])) {
$insurance = $data[1];
}
break;
}
}
if ((float)$cost) {
$title = $this->language->get('text_special_delivery_500');
if ($this->config->get('royal_mail_display_weight')) {
$title .= ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')';
}
if ($this->config->get('royal_mail_display_insurance') && (float)$insurance) {
$title .= ' (' . $this->language->get('text_insurance') . ' ' . $this->currency->format($insurance) . ')';
}
$quote_data['special_delivery_500'] = array(
'code' => 'royal_mail.special_delivery_500',
'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')))
);
}
}
i have now added special delivery to royalmail, see this thread here http://forum.opencart.com/viewtopic.php?f=161&t=18887djamorpheus wrote:The Special Delivery was something I added myself, but i've updated the royal mail module to the revision r558 one just here http://code.google.com/p/opencart/source/detail?r=558. The insurance is still acting funny its showing up in the line as insured up to 0.90 p when it should be added to the total.
Code: Select all
$rates = explode(',', $this->config->get('royal_mail_special_delivery_500_insurance')); foreach ($rates as $rate) { $data = explode(':', $rate); if ($data[0] >= $sub_total) { if (isset($data[1])) { $insurance = $data[1]; } break; } } if ((float)$cost) { $title = $this->language->get('text_special_delivery_500'); if ($this->config->get('royal_mail_display_weight')) { $title .= ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')'; } if ($this->config->get('royal_mail_display_insurance') && (float)$insurance) { $title .= ' (' . $this->language->get('text_insurance') . ' ' . $this->currency->format($insurance) . ')'; } $quote_data['special_delivery_500'] = array( 'code' => 'royal_mail.special_delivery_500', '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'))) ); } }
I don't have problems with special delivery and selecting it for the UK. My problem is that compensation isn't being calculated depending on the threshold you set for the sub total and isn't added to the total.
EDIT: Nevermind i figured it out.
EDIT: Nevermind i figured it out.
Code: Select all
foreach ($rates as $rate) {
$data = explode(':', $rate);
if ($data[0] >= $sub_total) {
if (isset($data[1])) {
$insurance = $data[1];
// add this line to calculate compensation.
$cost += $insurance;
}
break;
}
}
Who is online
Users browsing this forum: No registered users and 1 guest