Post by JordyC » Sat Apr 10, 2010 1:48 am

The cost of sending post with royal mail has risen a little. I thought OpenCart automatically updates but unfortunately it doesn't seem to have so I request it to be changed to match the new prices as now all my shipping costs on my cart are now outdated and too low. This needs changing asap as im sure alot of people use Royail Mail and OpenCart

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by JordyC » Sun Apr 11, 2010 6:30 am

Anychance anyone has seen this thread yet? lol Its a issue for myself as I need the prices to be exact so I dont end up spending my own money paying for other peoples shipping while OpenCart says shipping is cheaper than it actually is.

Temp Fix or anything if available will be appreciated!

Regards
Jordan

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by Xsecrets » Sun Apr 11, 2010 12:16 pm

the royal mail module gets the prices from an api they are not set by opencart. there is nothing opencart can do if they raised their prices and didn't update the api server. One workaround would be to add a handling fee there is an order total module for that.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by Qphoria » Sun Apr 11, 2010 1:12 pm

Actually, the Royal mail doesn't use live lookup. It has the rates hardcoded right into the file. At the very least they should be editable from the admin.

For now, to fix it,

1. EDIT: catalog/model/shipping/royal_mail.php
2. Try to follow the rate breakdown and adjust as needed. It looks like a lot of work went into hardcoding the rates. I think it would have been less work to just integrate with the api.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by JordyC » Sun Apr 11, 2010 5:14 pm

Im looking at the file now and have No idea what im doing lol. May just have to use another cart system untill Opencart can update the prices. Need my cart updated asap as customers are waiting but I dont understand any of the Rate Breakdown, cant even find the new pricing rates eithier lol.

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by Xsecrets » Sun Apr 11, 2010 11:46 pm

Qphoria wrote:Actually, the Royal mail doesn't use live lookup. It has the rates hardcoded right into the file. At the very least they should be editable from the admin.

For now, to fix it,

1. EDIT: catalog/model/shipping/royal_mail.php
2. Try to follow the rate breakdown and adjust as needed. It looks like a lot of work went into hardcoding the rates. I think it would have been less work to just integrate with the api.
ok sorry I didn't bother looking at the files I just figured noone would bother doing all that work instead of connecting it to the api since it could so easily break and make them do it all over again.

OpenCart commercial mods and development http://spotonsolutions.net
Layered Navigation
Shipment Tracking
Vehicle Year/Make/Model Filter


Guru Member

Posts

Joined
Sun Oct 25, 2009 3:51 am
Location - FL US

Post by roastchicken » Fri Apr 16, 2010 10:16 pm

hi
Whats the conclusion with Royal mail then. Is it using an API or are the costs hard-coded ?

Newbie

Posts

Joined
Thu Mar 25, 2010 11:37 pm

Post by Qphoria » Fri Apr 16, 2010 10:53 pm

roastchicken wrote:hi
Whats the conclusion with Royal mail then. Is it using an API or are the costs hard-coded ?
hardcoded.

Rather than update the hardcoded rates it would be best just to use their API. I'll add it to the list but the priority is low at this time.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by chriszammett » Sat Apr 17, 2010 12:05 am

if anyone is interested I have started to hard code this. I will be doing it for 1st class (and recorded) and 2nd class (and recorded).

this is 1st class recorded code (you only need the $rates = explode line):

if ($this->config->get('royal_mail_1st_class_recorded') && $address['iso_code_2'] == 'GB') {
$cost = 0;
$compensation = 0;

$rates = explode(',', '.1:2.13,.25:2.46,.5:2.98,.75:3.49,1:4.09,1.25:5.24,1.5:5.94,1.75:6.64,2:7.34,4:8.96,6:12.50,8:15.30,10:18.10');

New member

Posts

Joined
Wed Apr 07, 2010 9:17 pm

Post by chriszammett » Sat Apr 17, 2010 12:13 am

1st class:

if ($this->config->get('royal_mail_1st_class_standard') && $address['iso_code_2'] == 'GB') {
$cost = 0;
$compensation = 0;

$rates = explode(',', '.1:1.39,.25:1.72,.5:2.24,.75:2.75,1:3.35,1.25:4.50,1.5:5.20,1.75:5.90,2:6.60,4:8.22,6:11.02,8:13.82,10:16.62');

New member

Posts

Joined
Wed Apr 07, 2010 9:17 pm

Post by chriszammett » Sat Apr 17, 2010 12:17 am

second class

if ($this->config->get('royal_mail_2nd_class_standard') && $address['iso_code_2'] == 'GB') {
$cost = 0;

$rates = explode(',', '.1:1.17,.25:1.51,.5:1.95,.75:2.36,1:2.84');

New member

Posts

Joined
Wed Apr 07, 2010 9:17 pm

Post by chriszammett » Sat Apr 17, 2010 12:19 am

second class recorded

if ($this->config->get('royal_mail_2nd_class_recorded') && $address['iso_code_2'] == 'GB') {
$cost = 0;
$compensation = 0;

$rates = explode(',', '.1:1.91,.25:2.25,.5:2.69,.75:3.10,1:3.58');

New member

Posts

Joined
Wed Apr 07, 2010 9:17 pm

Post by JordyC » Sun Apr 18, 2010 5:25 pm

Thanks for the new changes! I've put them in and price is correct :)

Im looking for the AIRMAIL one next if you have that one available soon :P

Thanks,
Jordan

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by JordyC » Mon Apr 26, 2010 5:33 pm

Anyone have the code for AIRMAIL? Royail Mail prices on OpenCart are still wrong apart from the ones chris gave us.

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by spaceman » Wed May 12, 2010 2:56 am

Just sharing the code for Royal Mail Airmail:

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:2.12,0.24:2.24,0.26:2.37,0.28:2.51,0.3:2.65,0.32:2.77,0.34:2.89,0.36:3.01,0.38:3.13,0.4:3.25,0.42:3.37,0.44:3.49,0.46:3.61,0.48:3.73,0.5:3.85,0.52:3.96,0.54:4.07,0.56:4.18,0.58:4.29,0.6:4.4,0.62:4.51,0.64:4.62,0.66:4.73,0.68:4.84,0.7:4.95,0.72:5.06,0.74:5.17,0.76:5.28,0.78:5.39,0.8:5.5,0.82:5.61,0.84:5.72,0.86:5.83,0.88:5.94,0.9:6.05,0.92:6.16,0.94:6.27,0.96:6.38,0.98:6.49,1:6.6,1.02:6.7,1.04:6.8,1.06:6.9,1.08:7,1.1:7.1,1.12:7.2,1.14:7.3,1.16:7.4,1.18:7.5,1.2:7.6,1.22:7.7,1.24:7.8,1.26:7.9,1.28:8,1.3:8.1,1.32:8.2,1.34:8.3,1.36:8.4,1.38:8.5,1.4:8.6,1.42:8.7,1.44:8.8,1.46:8.9,1.48:9,1.5:9.1,1.52:9.2,1.54:9.3,1.56:9.4,1.58:9.5,1.6:9.6,1.62:9.7,1.64:9.8,1.66:9.9,1.68:10,1.7:10.1,1.72:10.2,1.74:10.3,1.76:10.4,1.78:10.5,1.8:10.6,1.82:10.7,1.84:10.8,1.86:10.9,1.88:11,1.9:11.1,1.92:11.2,1.94:11.3,1.96:11.4,1.98:11.5,2:11.6');

} 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:3.46,0.24:3.71,0.26:3.96,0.28:4.22,0.3:4.47,0.32:4.71,0.34:4.95,0.36:5.19,0.38:5.43,0.4:5.67,0.42:5.91,0.44:6.15,0.46:6.39,0.48:6.63,0.5:6.87,0.52:7.09,0.54:7.31,0.56:7.53,0.58:7.75,0.6:7.97,0.62:8.19,0.64:8.41,0.66:8.63,0.68:8.85,0.7:9.07,0.72:9.29,0.74:9.51,0.76:9.73,0.78:9.95,0.8:10.17,0.82:10.39,0.84:10.61,0.86:10.83,0.88:11.05,0.9:11.27,0.92:11.49,0.94:11.71,0.96:11.93,0.98:12.15,1:12.37,1.02:12.59,1.04:12.81,1.06:13.03,1.08:13.25,1.1:13.47,1.12:13.69,1.14:13.91,1.16:14.13,1.18:14.35,1.2:14.57,1.22:14.79,1.24:15.01,1.26:15.23,1.28:15.45,1.3:15.67,1.32:15.89,1.34:16.11,1.36:16.33,1.38:16.55,1.4:16.77,1.42:16.99,1.44:17.21,1.46:17.43,1.48:17.65,1.5:17.87,1.52:18.09,1.54:18.31,1.56:18.53,1.58:18.75,1.6:18.97,1.62:19.19,1.64:19.41,1.66:19.63,1.68:19.85,1.7:20.07,1.72:20.29,1.74:20.51,1.76:20.73,1.78:20.95,1.8:21.17,1.82:21.39,1.84:21.61,1.86:21.83,1.88:22.05,1.9:22.27,1.92:22.49,1.94:22.71,1.96:22.93,1.98:23.15,2:23.37');

}

Newbie

Posts

Joined
Sun May 09, 2010 6:46 pm

Post by chriszammett » Fri May 21, 2010 12:13 am

after successfully altering the prices, they still show wrong when you checkout. Anyone know why this would be?

New member

Posts

Joined
Wed Apr 07, 2010 9:17 pm

Post by Richard Simpson » Sun May 30, 2010 1:40 am

I hope they do this with API soon, This method sounds like it doesnt work properly :(


Posts

Joined
Sun May 16, 2010 9:44 pm

Post by spaceman » Mon May 31, 2010 6:57 pm

The above code snippets are all working correctly. I use them for a variety of shopping carts with no problems. It's worth checking that the file has been uploaded correctly to your webspace (model/shipping/royal_mail.php). If it still causes problems I can upload the entire file for you to download, however this may have already been done in the latest version due out imminently.

Speaking to Royal Mail IT dept., they currently do not have an api for this however are looking to produce one hopefully next year! They are also currently not able to offer a csv file with all the shipping rates in.

Newbie

Posts

Joined
Sun May 09, 2010 6:46 pm

Post by JordyC » Tue Jun 01, 2010 7:02 pm

I have finished making the changes and it seems perfect :) Thank you everyone.

Here is my Royal Mail file with the newly updated rates etc so people can just replace it with their old one.

WARNING: I do not take any responsibility of your OpenCart store using the file I've provided, use this file at your own risk.

<<-- Hate saying this but might aswell in case some noob thinks i've screwed his OpenCart. The file is all updated for me. I think there may be one other rate to update but tell me if needed.

Newbie

Posts

Joined
Mon Apr 05, 2010 2:56 am

Post by twuncher » Wed Jun 02, 2010 5:07 am

were you supposed to attach it? ;)

Newbie

Posts

Joined
Sat May 15, 2010 7:42 pm
Who is online

Users browsing this forum: Baidu [Spider] and 22 guests