Post by djamorpheus » Tue Sep 13, 2011 8:12 pm

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.

Newbie

Posts

Joined
Mon Sep 12, 2011 8:56 pm

Post by uksitebuilder » Wed Sep 14, 2011 6:39 am

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.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by djamorpheus » Wed Sep 14, 2011 8:24 pm

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

Newbie

Posts

Joined
Mon Sep 12, 2011 8:56 pm

Post by djamorpheus » Thu Sep 15, 2011 7:10 pm

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

Newbie

Posts

Joined
Mon Sep 12, 2011 8:56 pm

Post by uksitebuilder » Fri Sep 16, 2011 12:09 am

Special Delivery next Day is not in my file above

Where did you get the file from ?

Maybe you should ask them ?

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by djamorpheus » Fri Sep 16, 2011 11:52 pm

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')))
                                        );
                                }
                        }

Newbie

Posts

Joined
Mon Sep 12, 2011 8:56 pm

Post by werepair » Sun Sep 18, 2011 10:03 pm

djamorpheus 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 have now added special delivery to royalmail, see this thread here http://forum.opencart.com/viewtopic.php?f=161&t=18887

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by djamorpheus » Wed Sep 21, 2011 7:18 pm

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.

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;
                                        }
   }

Newbie

Posts

Joined
Mon Sep 12, 2011 8:56 pm
Who is online

Users browsing this forum: No registered users and 1 guest