Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIB] UK Royal Mail & Overseas Shipping Methods


Guest

Recommended Posts

hhmmm,

not sure what's going on Jay. IMO you shouldn't need to reduce the weight to 0.9kg in the file rmsecond to take account of the tare weight of 0.1kg - there must be something else a miss.

 

what do you have for the configuration settings for shipping?

what other postage options do you have installed?

what prices do you have for rmsecond?

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

hhmmm,

not sure what's going on Jay. IMO you shouldn't need to reduce the weight to 0.9kg in the file rmsecond to take account of the tare weight of 0.1kg - there must be something else a miss.

 

what do you have for the configuration settings for shipping?

what other postage options do you have installed?

what prices do you have for rmsecond?

 

In shipping, the modules I have all the Royal Mail ones in this contribution as well as Citylink. No others as we only deal in the UK market. I have not modified any of the files (apart from reducing the overall limit by 0.1kg as that is my Tare Weight). I have no other shipping modules active or installed. In configuration / shipping, Tare Weight is set to '0.1' and increase for larger parcels set to '0' as it is not required.

 

As an example of prices, my rmsecond text string is '0:0,.1:.92,.25:1.20,.5:1.52,.75:1.92,1:2.30' - as these are only the prices, they are not an issue and should not effect the weight comparison calculation.

 

As I mentioned earlier, when I echo out the values of both $shipping_weight and $total_weight, $total_weight = the weight of the goods themselves (as the variable name suggests) and $shipping_weight is the weight of the goods PLUS the Tare weight (again, as the variable name suggests).

 

I'm wondering if, because many of my items are weighed in exact kilograms, this has not been apparerent in many other installations.

 

Its not a big issue for me to have hard coded the tare into the maximums in each module php file. I've not made any other changes and by echoing out the above values I know that if I can use $shipping_weight as my comparison variable for the maximum allowed weight, it will work.

 

Cheers for the replies ;)

Link to comment
Share on other sites

Ok, written a solution for this. Its been tested in both my live server and my development server and works in both.

 

In checkout_shipping.php find:

 

$total_count = $cart->count_contents();

 

and immediately after it paste:

 

$total_package_weight = $total_weight+SHIPPING_BOX_WEIGHT;

 

In each of your shipping modules for this contribution (eg rmfirst.php), find:

 

global $order, $total_weight;

 

and change to:

 

global $order, $total_weight, $total_package_weight;

 

and then find:

 

if ($total_weight >

 

and replace with:

 

if ($total_package_weight >

 

The issue is that $total_weight is solely the weight of the goods themselves and does not include the tare weight of any packaging.

 

$shipping_weight DOES contain both the total weight of the goods as well as the tare but is defined after the shipping modules are called.

 

By creating a new variable $total_package_weight and defining its value at the same time as $total_weight is defined, it passes the correct total weight of the parcel and packaging to the comparator for the maximum weight allowed for each mail and courier service.

Edited by UKJay
Link to comment
Share on other sites

Update

 

The above works fine for those who are not using the 'Larger Packages Percentage Increase' option in Admin / Configuration but I appreciate that many of you will want to use this so in checkout_shipping.php, instead of adding the line above, add:

 

if (SHIPPING_BOX_WEIGHT >= $total_weight*SHIPPING_BOX_PADDING/100) {
	  $total_package_weight = $total_weight+SHIPPING_BOX_WEIGHT;
	} else {
	  $total_package_weight = $total_weight + ($total_weight*SHIPPING_BOX_PADDING/100);
	}

 

 

Another small issue

 

I noticed that when a load is split into 2 or more packages because of the weight, the modules were outputting the correct rates but were not declaring the correct weights - they were only showing the remainder weight after the other full packages were calculated. Hard to explain but what I mean is

 

If you have set your largest package to 20kgs and your order is 30kgs, the correct shipping rate is shown but the text will delcare the weight of the package as 10kg (30kg - 20kg). This might not be an issue for many of you but if you want it fixed and have already coded the above changes then:

 

In your installed modules from this contribution, find:

 

global $order, $shipping_weight, $shipping_num_boxes;

 

and replace it with:

 

global $order, $shipping_weight, $shipping_num_boxes, $total_package_weight;

 

Find:

 

// Text shown on Checkout_shipping -  Delivery Weight : 0.7 Kg's (Ships normally within 1 to 3 days)
		$shipping_method = MODULE_SHIPPING_RMSTANDARDPARCEL_TEXT_WAY . ' : ' . $shipping_weight . ' ' .

 

and replace the

$shipping_weight

with

$total_package_weight

(note the MODULE-SHIPPING_ will change depending on the module you are amending)

 

I'll see if I can trim this down any and add it as an updated contribution later when I get some time to play around with it a bit more.

Link to comment
Share on other sites

Im slightly confused, Ive always added the shipping price in with the price of the item. Ive now decided to install this. Ive setup my item weights, installed the various shipping methods supplied in this contribution, set my tare weight, added additional costs for packaging but when I checkout Im not being given any shipping options.

 

What have I missed, or where should I start looking?

Link to comment
Share on other sites

Im slightly confused, Ive always added the shipping price in with the price of the item. Ive now decided to install this. Ive setup my item weights, installed the various shipping methods supplied in this contribution, set my tare weight, added additional costs for packaging but when I checkout Im not being given any shipping options.

 

What have I missed, or where should I start looking?

I experienced this - do write things down but so many things...can't remember what fixed it...

 

Does each shipping type have a different display sort order?

Check your max packet weight in configuration.

 

Tiger

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

oh, and you have set them to "TRUE"?

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

I experienced this - do write things down but so many things...can't remember what fixed it...

 

Does each shipping type have a different display sort order?

Check your max packet weight in configuration.

 

Tiger

 

Ive only enabled one shipping type at the moment RM 1st class recorded, my max packet weight is 50 and Ive amended the scripts so it doesnt have the £ or weight restrictions in it. Just to make sure the item Im using has a value of £25 and a weight of 1, I have tare weight set at 1 as well. So it should be picked up.

Link to comment
Share on other sites

  • 3 weeks later...
Update

 

The above works fine for those who are not using the 'Larger Packages Percentage Increase' option in Admin / Configuration but I appreciate that many of you will want to use this so in checkout_shipping.php, instead of adding the line above, add:

 

if (SHIPPING_BOX_WEIGHT >= $total_weight*SHIPPING_BOX_PADDING/100) {
	  $total_package_weight = $total_weight+SHIPPING_BOX_WEIGHT;
	} else {
	  $total_package_weight = $total_weight + ($total_weight*SHIPPING_BOX_PADDING/100);
	}

 

Hi Jay,

not been on here for a while. I hadn't previously experienced the £0.00 problem, but now I see it. Definately seems like its to do with the tare weight. Seems to happen around the max weight figure for me.

 

I prefer to use tare weight. Do you know if the code you posted would alter any of the other shipping modules besides this RM mod?

 

thanks

Tiger

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

Ok, written a solution for this. Its been tested in both my live server and my development server and works in both.

 

In checkout_shipping.php find:

 

$total_count = $cart->count_contents();

 

and immediately after it paste:

 

$total_package_weight = $total_weight+SHIPPING_BOX_WEIGHT;

 

In each of your shipping modules for this contribution (eg rmfirst.php), find:

 

global $order, $total_weight;

 

and change to:

 

global $order, $total_weight, $total_package_weight;

 

and then find:

 

if ($total_weight >

 

and replace with:

 

if ($total_package_weight >

 

The issue is that $total_weight is solely the weight of the goods themselves and does not include the tare weight of any packaging.

 

$shipping_weight DOES contain both the total weight of the goods as well as the tare but is defined after the shipping modules are called.

 

By creating a new variable $total_package_weight and defining its value at the same time as $total_weight is defined, it passes the correct total weight of the parcel and packaging to the comparator for the maximum weight allowed for each mail and courier service.

 

Update

 

The above works fine for those who are not using the 'Larger Packages Percentage Increase' option in Admin / Configuration but I appreciate that many of you will want to use this so in checkout_shipping.php, instead of adding the line above, add:

 

CODE

if (SHIPPING_BOX_WEIGHT >= $total_weight*SHIPPING_BOX_PADDING/100) {

$total_package_weight = $total_weight+SHIPPING_BOX_WEIGHT;

} else {

$total_package_weight = $total_weight + ($total_weight*SHIPPING_BOX_PADDING/100);

}

 

Hi does anyone know if this fix will alter the functioning of any other shipping modules/ settings at all?

 

 

thanks

Tiger

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

Please can someone help with this £0.00 issue when the cart weight exceeds the max weight allowed. I tried Jays fix but it does not work for me. There is definately a conflict with the tare weight and the item weight being added together causing £0.00 shipping cost to be displayed. I really want to be able to use tare weight so my shiiping costs are accurate.

 

thanks in advance

Tiger

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

Hi, i get the following error message in my osc admin --->modules --->shipping

 

Cannot redeclare class airmail in /airmail.php on line 113

 

I did not do any changes to the airmail.php when uploading it so i dont know why it wont call this class:

 

Here is the code around #113 what exactly is wrong?

 

 It appears that the osC shipping system automatically rounds the
shipping weight up to the nearest whole unit.  This makes it more
difficult to design precise shipping tables.  If you want to, you
can hack the shipping.php file to get rid of the rounding.

Lastly, there is a limit of 255 characters on each of the Zone
Shipping Tables and Zone Countries.

*/

class airmail {
  var $code, $title, $description, $enabled, $num_zones;

// class constructor
  function airmail() {
  global $order;
    $this->code = 'airmail';
    $this->title = MODULE_SHIPPING_AIRMAIL_TEXT_TITLE;
    $this->description = MODULE_SHIPPING_AIRMAIL_TEXT_DESCRIPTION;
    $this->sort_order = MODULE_SHIPPING_AIRMAIL_SORT_ORDER;
     $this->icon = DIR_WS_ICONS . 'shipping_airmail.gif'; // upload icon to catalog/images/icon directory
    $this->tax_class = MODULE_SHIPPING_AIRMAIL_TAX_CLASS;
    $this->enabled = ((MODULE_SHIPPING_AIRMAIL_STATUS == 'True') ? true : false);
 if ($order->delivery['country']['iso_code_2'] == 'GB')  {
 $this->enabled = false;
 }

 

Thanks for any help

Link to comment
Share on other sites

I have a problem with the Airmail for overseas shipping. How do I increase the 2kg maximum weight?

 

I have inserted some higher weights in includes/modules/shipping/airmail.php, but checkout will still not go above 2kg.

 

Obviously I can change the words in includes/languages/english/modules/shipping/airmail.php, but which file sets the 2kg maximum figure?

 

Can anyone help please?

Link to comment
Share on other sites

  • 1 month later...

hi guys

i got this contrib working however i would like to change the background of the bar that shows the cost of the shipping, at the moment is light blue color and as my site is dark background and light text it renders the costs and time it takes unreadable, can someone please tell me where i would have to edit to change the colour of this field, to black pref.

I dont help with templates (thats what the seller is for)

 

th search function will often help, when it dont try this in google.

 

site:http://www.oscommerce.com/forums then your search word

Link to comment
Share on other sites

  • 2 weeks later...

Hey guys,

 

I am using your contrib which works great, my boss has also started sending out some stuff via couriers. Does anyone know a way of attaching a set price for different zones on selected products only?

 

Cheers.

Link to comment
Share on other sites

This Contrib is very cool and I have been through this thread and there has been a lot of useful stuff. But I could do with some help. We have a lot of international customers through our existing shop and we have built a new one using oscom and I have installed this contrib, as this pretty much covers our postage needs, except for one thing. We need to have both "Airmail International Signed For" as well as "Airmail International". I have noticed a few post have been made on this subject, and there has been no really assistance on getting round this problem, so I was wondering if anyone has any suggestions on how I can get around this issue.

 

I would really appreciate any assistance that anyone can give.

 

I look forward to hearing from anyone.

 

thanks

 

Chrisp-3DT

Link to comment
Share on other sites

OK I didnt follow the instructions (I Think) in that I did not need all modules, so only installed what I needed. I got instances of �0.00 options coming up, and of course if its free you can bet your life some plonker will choose it.

 

If you get this like me, in the module where you get it, or add it to all to make sure there is no chance any one picks free shipping!!

if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_CITYLINK_INVALID_ZONE;

 

and add this after it

 

if ($shipping_method == MODULE_SHIPPING_CITYLINK_UNDEFINED_RATE ) $this->quotes['error'] = $shipping_method;

 

All you need to do is keep an eye on the module name and change the

 

MODULE_SHIPPING_CITYLINK_UNDEFINED_RATE

 

name of the module

 

The code above and below was done in the city link module

 

I used this fix on every module to get rid of the £0.00 problem. It's not a 100% fix as the "cart weight exceeded" still shows occasionally but at least the customer cannot select £0.00 cost shipping.

 

The other problem I notice will this module is that if your customer tries to order products that weigh more then you ship, no postage optoion will show and they can check out without selecting any postage! I just put a restrictive cost of £1000.00 on 20 - 100kg to stop people ordering stuff that heavy.

 

Hope that helps someone.

I'm feeling lucky today......maybe someone will answer my post!

I do try and answer a simple post when I can just to give something back.

------------------------------------------------

PM me? - I'm not for hire

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi

 

I am looking at this for a more acurate shipping price below a certain spend.

 

My question is...Can I also have free UK shipping enabled over a certain order value? International is at cost.

 

Would I need to install another shipping option or can it be integrated into this module?

 

Thanks

Julie

Link to comment
Share on other sites

This Contrib is very cool and I have been through this thread and there has been a lot of useful stuff. But I could do with some help. We have a lot of international customers through our existing shop and we have built a new one using oscom and I have installed this contrib, as this pretty much covers our postage needs, except for one thing. We need to have both "Airmail International Signed For" as well as "Airmail International". I have noticed a few post have been made on this subject, and there has been no really assistance on getting round this problem, so I was wondering if anyone has any suggestions on how I can get around this issue.

 

I would really appreciate any assistance that anyone can give.

 

I look forward to hearing from anyone.

 

thanks

 

Chrisp-3DT

Hi Chris

 

Did you solve this?

 

Julie

Link to comment
Share on other sites

  • 2 weeks later...

This addon is superb.

 

I do however have one issue. 1 item in my inventory I have to insist that it is sent at least Recorded Delivery. It weigh's in at 1.8Kg's and is worth £299. It's the most expensive thing I sell (and most popular).

 

I only post to the UK, so Zone's doesnt really come into it I believe. (Only just installed addon!)

What it is for this item and perhaps a couple of others, I do not want to give the customer the option of Standard/2nd Class etc.

 

Can this been done somehow?

Link to comment
Share on other sites

  • 2 weeks later...

I'm trying to install this contribution but am obviously not understanding.

 

I have done this:

 

Step (1) Open catalog/checkout_shipping.php

-------------------------------------------

In checkout_confirmation, double brackets are shown and not required, so the below edit

removes this.

 

[Find around Line 121 in catalog/checkout_shipping.php]

 

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),

 

[CHANGE TO]

 

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . $quote[0]['methods'][0]['title']),

 

 

Step (2) Upload Shipping Modules

--------------------------------

Each Shipping method has 3 files each, decide which shipping methods you want to

install and upload the shipping file located in catalog/includes/modules/shipping/

and also its corresponding langauage file located in

catalog/includes/languages/english/modules/shipping/ also included is an image icon,

upload this into your images directory.

Now goto your OSC admin panel modules-->shipping and adjust anything to suit your

needs.

 

I have nothing new in my shipping area - I have tried turning everything on - but I get no postal charge when I go to checkout - plus I'm not sure what I'm meant to do with the prices listed below.

 

CAn anyone help?

Link to comment
Share on other sites

I'm trying to install this contribution but am obviously not understanding.

 

I have done this:

 

Step (1) Open catalog/checkout_shipping.php

-------------------------------------------

In checkout_confirmation, double brackets are shown and not required, so the below edit

removes this.

 

[Find around Line 121 in catalog/checkout_shipping.php]

 

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),

 

[CHANGE TO]

 

'title' => (($free_shipping == true) ? $quote[0]['methods'][0]['title'] : $quote[0]['module'] . $quote[0]['methods'][0]['title']),

Step (2) Upload Shipping Modules

--------------------------------

Each Shipping method has 3 files each, decide which shipping methods you want to

install and upload the shipping file located in catalog/includes/modules/shipping/

and also its corresponding langauage file located in

catalog/includes/languages/english/modules/shipping/ also included is an image icon,

upload this into your images directory.

Now goto your OSC admin panel modules-->shipping and adjust anything to suit your

needs.

 

I have nothing new in my shipping area - I have tried turning everything on - but I get no postal charge when I go to checkout - plus I'm not sure what I'm meant to do with the prices listed below.

 

CAn anyone help?

 

It's ok I worked it out - thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...