Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to add additional shipping zomes for zone based calculation?


Carpaltunnel

Recommended Posts

I cannot for the life of me figure how to create a Zone 2 for zone based shipping and assign countries to Zone 2 and so on. My primary zone will include USA and Canada but want to create zones for the Caribbeans and Europe too all to use flat shipping fees.

 

Carp

Link to comment
Share on other sites

I cannot for the life of me figure how to create a Zone 2 for zone based shipping and assign countries to Zone 2 and so on. My primary zone will include USA and Canada but want to create zones for the Caribbeans and Europe too all to use flat shipping fees.

 

Carp

 

Helle Carp,

 

It's a bit hidden but you can change, and find more details, inside the zones.php file itself which resides in (catalog)/includes/modules/shipping. Inside this file you will find

	  // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
  $this->num_zones = 1;

Change the number to how many zones you want and after that you will have to go through your admin and first remove the zone module and directly after that install it again. This is neccessary to make the changes visible and you will have the amout of zones specified.

 

regards,

Howard

Link to comment
Share on other sites

Thank you dearly, I think they should hide this very important option better God forbid someone actually can find and use it :)

 

Carp

 

OK I edited the file uninstalled teh module, reinstalled it and it still only showing in store/admin/modules.php?set=shipping&module=zones&action=edit

only

Enable Zones Method

Do you want to offer zone rate shipping?

 

True

False

 

Tax Class

Use the following tax class on the shipping fee.

--none--Taxable Goods

 

Sort Order

Sort order of display.

 

 

Zone 1 Countries

Comma separated list of two character ISO country codes that are part of Zone 1.

 

 

Zone 1 Shipping Table

Shipping rates to Zone 1 destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone 1 destinations.

 

 

Zone 1 Handling Fee

Handling Fee for this shipping zone

 

 

 

 

No additional zones are displayed. I am puzzled to say the least

 

Carp

Link to comment
Share on other sites

Thank you dearly, I think they should hide this very important option better God forbid someone actually can find and use it :)

 

Carp

 

OK I edited the file uninstalled teh module, reinstalled it and it still only showing in store/admin/modules.php?set=shipping&module=zones&action=edit

only

Enable Zones Method

Do you want to offer zone rate shipping?

 

True

False

 

Tax Class

Use the following tax class on the shipping fee.

--none--Taxable Goods

 

Sort Order

Sort order of display.

Zone 1 Countries

Comma separated list of two character ISO country codes that are part of Zone 1.

Zone 1 Shipping Table

Shipping rates to Zone 1 destinations based on a group of maximum order weights. Example: 3:8.50,7:10.50,... Weights less than or equal to 3 would cost 8.50 for Zone 1 destinations.

Zone 1 Handling Fee

Handling Fee for this shipping zone

 

 

 

 

No additional zones are displayed. I am puzzled to say the least

 

Carp

 

I am puzzled to as I have not heard or experienced something similar. Have you checked the zones.php file on your server if it is indeed changed for the num_zones ?

Try it again to make sure you don't have gotten some kind of cached version.

Link to comment
Share on other sites

Hiya

 

I have managed to follow the above instructions and get all the zones I want, however I have another problem.

 

We want to offer normal postage rates and registered postage rates - ie the customer chooses which rate.

 

How do I implement this?

 

Any help would be greatly appreciated

 

Annie

Link to comment
Share on other sites

Hiya

 

I have managed to follow the above instructions and get all the zones I want, however I have another problem.

 

We want to offer normal postage rates and registered postage rates - ie the customer chooses which rate.

 

How do I implement this?

 

Any help would be greatly appreciated

 

Annie

 

For something similar, offering priority and standard shipment, I use this contribution you could take a look at.

With that you get two zone modules which you can configurate seperately, one for normal postage rates and one for registered postage rates.

Link to comment
Share on other sites

Thanks Howard,

 

Downloaded, followed instructions and when I clicked on shipping in admin I got the following message

 

Fatal error: Cannot redeclare class zones2 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 116

 

Help ! Again ! :o

Link to comment
Share on other sites

Hmmm after clicking on all the options in shipping the error changed to

 

Fatal error: Cannot redeclare class zones in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones.php on line 118

Link to comment
Share on other sites

Hmmm after clicking on all the options in shipping the error changed to

 

Fatal error: Cannot redeclare class zones in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones.php on line 118

 

Did you uninstall the original zones module first ? After that you should rename the original zones.php to zones.php.org or something for safekeeping and copy those from the contribution package.

There shouldn't be any error when using this contrib, at least I didn't have these problems when I first installed it.

Link to comment
Share on other sites

I uninstalled all shipping modules before starting however I did not take a backup of zones.php so now I guess I'm up the creak without a paddle!

 

Any ideas?

Link to comment
Share on other sites

I uninstalled all shipping modules before starting however I did not take a backup of zones.php so now I guess I'm up the creak without a paddle!

 

Any ideas?

 

No, it won't be that bad. I assume you still have the original osCommerce download package somewhere around and otherwise you just download it again. From that package you can pick whatever individual file you need and place it where it belongs so you can always revert back to an original in case needed.

You shouldn't have to though as the zone.php and zone2.php from the contrib should work fine together.

Do you have other shipping modules in place besides the original osCommerce ones and the zones contrib ?

Link to comment
Share on other sites

Hiya

 

I worked it out and now have the modules ready to install, so thanks very much for all your help.

 

How do I get one to say that it's standard shipping and the other to say Express shipping.

Link to comment
Share on other sites

Hiya

 

I worked it out and now have the modules ready to install, so thanks very much for all your help.

 

How do I get one to say that it's standard shipping and the other to say Express shipping.

 

Annie,

 

You can change those in the belonging language files for these two modules.

Look in (catalog)/includes/languages/english/modules/shipping and edit the zones.php and zones2.php files language files. The define

define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Standaard/Economy verzendingstarief');

should give you the change you want.

 

Howard

Link to comment
Share on other sites

Back again :P

 

On testing the shopping cart I get the following errors - can you help?

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_4 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_5 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_6 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_7 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_8 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Also I presumed that the weight for shipping would be in gms and apparantly its in pounds - any idea how I change it so that it weighs in grams?

 

Fixed the shipping modules error - all I need to find out about now is changing the weights used

Link to comment
Share on other sites

Back again :P

 

On testing the shopping cart I get the following errors - can you help?

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_4 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_5 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_6 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_7 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Warning: constant(): Couldn't find constant MODULE_SHIPPING_ZONES2_COUNTRIES_8 in /home/sites/babyshoebox.com/public_html/store/includes/modules/shipping/zones2.php on line 148

 

Also I presumed that the weight for shipping would be in gms and apparantly its in pounds - any idea how I change it so that it weighs in grams?

 

Fixed the shipping modules error - all I need to find out about now is changing the weights used

 

Hi there Annie,

 

I see you have some more struggles with this module :-)

Did you have more zones defined in between as the default three the contrib has ? It seems it is looking for 8 entries and only three are defined in your database.

 

As for the weight: in the accompanying language files it says lbs which you can change to grams or whatever you want to use. It's only a textual thing and the way you setup the tables and put the weight with your products is the only thing that really matters.

Ie. if you give your product a weight of 1 and you mean 1 kg. with that you should your table setup like

0.5:5,1:10 etc. saying up to 500 grams is $5 and from 500 grams to 1 kg is $10.

Just change the word lbs. to gram(s) or kilogram(s) whatever you are going to use.

 

cheers,

Howard

Link to comment
Share on other sites

Hi Howard

 

You are a total gem helping like this

 

the only files I can find the term 'lbs' in are the ups.php and usps.php - didn't think these were the files concerned but I guess I could be wrong. Are these the ones?

 

I've also noticed that instead of rounding off the weights it comes out at checkout as 49.094754754375 - is there any way to fix this?

 

Love

Annie

Link to comment
Share on other sites

Hi Howard

 

You are a total gem helping like this

 

the only files I can find the term 'lbs' in are the ups.php and usps.php - didn't think these were the files concerned but I guess I could be wrong. Are these the ones?

 

I've also noticed that instead of rounding off the weights it comes out at checkout as 49.094754754375 - is there any way to fix this?

 

Love

Annie

 

Hi Annie,

 

No, the ones concerning the zones shipping modules you will find in your (catalog)/includes/languages/english/modules/shipping directory. In both the zones.php and zones2.php language files you will find lb(s) and that's where you can change that.

As for the rounding I initially got the same output as you have now and i changed in both zones.php and zones2.php (this time the files with code in (catalog)/includes/modules/shipping)

			if (MODULE_SHIPPING_ZONES_MODE == 'weight') 
			$shipping_method .= " : " . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;

to

			if (MODULE_SHIPPING_ZONES_MODE == 'weight')
			$shipping_method .= " (" . $shipping_num_boxes . 'x ' . round($shipping_weight,1) . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS;

As you see I also put in the amount of packages but you can leave that of and just take the part for the rounding

round($shipping_weight,1)

Change the 1 to 2 or more if you want more figures as decimals.

 

Howard

Link to comment
Share on other sites

Hi Howard

 

if you give your product a weight of 1 and you mean 1 kg. with that you should your table setup like

0.5:5,1:10 etc. saying up to 500 grams is $5 and from 500 grams to 1 kg is $10.

 

Just wanted to double check I have understood this correctly.

 

My charges are

up to 250gms = ?1.50

up to 500gms = ?2.50

up to 1kg = ?4.00

up to 2kg = ?7.00

up to 4kg = ?10.00

 

Should the field be completed like

 

(a) .250:1.50,.500:2.50,1:4.00,2:7.00,4:10.00

 

or

 

(B) .250:1.5,.500:2.5,1:4,2:7,4:10

 

Annie

Link to comment
Share on other sites

Hi Howard

 

 

 

Just wanted to double check I have understood this correctly.

 

My charges are

up to 250gms = ?1.50

up to 500gms = ?2.50

up to 1kg = ?4.00

up to 2kg = ?7.00

up to 4kg = ?10.00

 

Should the field be completed like

 

(a) .250:1.50,.500:2.50,1:4.00,2:7.00,4:10.00

 

or

 

(B) .250:1.5,.500:2.5,1:4,2:7,4:10

 

Annie

 

Aniie,

 

This looks good and I don't think it will make any difference how you write the weight and/or amount.

Although more lengthy I would prefer the writing as you have done in (a) and would even put a leading zero before the weight like 0.250 and 0.500

Make a few test orders and you'll know quick enough if the setup is correct or not.

 

cheers,

Howard

Link to comment
Share on other sites

Ok, now I'm confused and don't know whats going wrong

 

The code for zone one is as follows

 

0.250:1.50,0.500:2.50,1.0:4.00,2.0:7.00,4.0:10.00

 

I did a test order for a product that has a weight of 0.25

 

the checkout gives the following

 

Postage and Package (by weight) (1x 3.25 Kgm(s) ?10.00

 

What's going wrong? Any ideas?

 

Annie

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...