Lee Willis

Region-based shipping with WP e-Commerce

| 328 Comments

I’ve been asked a few times about how to split up countries into regions and charge shipping differently to the different areas in WP E-Commerce. This was something that was almost, but not quite possible with one of my existing plugins.

Now it’s just a little bit easier.

What You’ll Need

In this example we’re going to show how to achieve the following:

  • Set of Weight rates for New Zealand (North Island)
  • Set of Weight rates for New Zealand (South Island)
  • Set of Weight rates for the rest of Asia/Pacific
  • Set of Weight rates for Europe

The Plan

To acheive our end goal we’re going to:

  1. Create 2 regions attached to the country “New Zealand”
  2. Remove New Zealand from the Asia and Pacific continent (So people ordering to NZ see those prices, not the general “Asia and Pacific” pricing
  3. Set up per-country/region rates for New Zealand
  4. Set up per-continent rates for Asia and Pacific, and Europe

Getting Started

The first job is to find out the “country ID” for New Zealand. Using your favourite database you’ll want to look in the wp_wpsc_currency_list table for the entry for New Zealand, and make a note of the value of the “id” field – in our case 156.

While we’re here, we’ll also move New Zealand out of it’s current continent. This basically just involves updating the same record, and setting the continent field to something unique, e.g.

Next – you’ll need to create whatever regions you want in the wp_wpsc_region_tax table, using the ID you’ve just found as the “country_id” field, e.g.

Configuring your pricing

That’s all with the scary database stuff, now on to the easy stuff. First of all you’ll need to activate both of the shipping modules:

First up we’ll configure the continent-based pricing. Click on “Edit” next to the weight-continent pricing. Up will pop the configuration pane, with a drop-down of the standard continents – and also our “newzealand” continent – which we’re not going to use since New Zealand is going to be priced by region.

Let’s pick Europe, and configure some weight rates.

In this case we’ve just configured one weight band – which means that anything shipped to Europe will be charged at the same rate – £80 in this case.

We can do the same for Asia and Pacific, except maybe setting up multiple layers using the “Add Layer” link.

At this stage shipping will work for Europe, Asia and Pacific, but not for New Zealand (Since we took it out of Asia and Pacific).

Click on “Edit” next to the Weight / Country and Region pricing. Up will pop the configuration pane, with a drop-down of the countries, including regions where configured – for example, we can see our North Island, and South Island regions here:

Selecting a region gives us the chance to configure weight rates, e.g.

Repeat for other regions, and you’re set. Happy Shipping!

Note: All weights should be set up in lbs, no matter what weight unit you used to set the weight for your products. WP e-Commerce will convert between them for you.

328 Comments

  1. Hi Lee

    Thanks for this plugin, it’s EXACTLY what I was looking for. Odd that WP E-Comm plugin didn’t have this built in, I assume it’s a pretty common style of shipping.

    Anyway, unfortunately I have an issue that I can’t resolve. After installing, I get the “Please provide a Zipcode and click Calculate in order to continue” error. The page FLATLY refuses to move forward from that point.

    Any suggestions?

    Regards,

    Jeff

  2. That error normally happens because the shipping modules don’t return a quote for the country /region you’re trying to ship to. In the case of my plugin, this would happen if you tried to ship to a continent that you hadn’t set a rate for and or a country & region that you hadn’t set a rate for.

  3. Hi Lee

    Yeah, I thought that might be the case, but I entered rates for a couple of countries (to test it out), and it still came up with that error (when I selected those countries). Do I have to enter rates for ALL countries (that I’m selling to as defined under the general settings), even if I’m not requesting a quote for it?

    Perhaps I’m entering the shipping rate info incorrectly? For example, for Australia I have entered:

    Weight Over: 2000 Shipping: 34
    Weight Over: 1250 Shipping: 26
    Weight Over: 900 Shipping: 21
    Weight Over: 750 Shipping: 18
    Weight Over: 600 Shipping: 14.50
    Weight Over: 450 Shipping: 11.50
    Weight Over: 300 Shipping: 8
    Weight Over: 150 Shipping: 5

    With the assumption that the weight is grams (how can I set this to default?) and the cost is in USD.

    Anything that you can spot that might be where I’m going wrong?

    Regards,

    Jeff

  4. Yes, I can :)

    The weights that you configure in the plugin are in pounds (lbs). WP e-Commerce converts all weights into pounds as part of the shipping calculations. So my guess is that your weight in grams is being converted to a small number of pounds (Less than 150) – so there’s no rate it can use.

    If you set a weight for 0 and over, and convert your weight bands into lbs it should all spring into life.

    Hope that helps.

  5. BINGO. Thanks for that Lee.

    Basically the figure “150″ (my lowest weight setting as per the previous comment) was being read by WP E-Comm as “150 POUNDS”. Lol. No wonder it was having a hernia.

    So therefore my figures SHOULD have been:

    Weight Over: 4.40 Shipping: 34
    Weight Over: 2.75 Shipping: 26
    Weight Over: 1.98 Shipping: 21
    Weight Over: 1.65 Shipping: 18
    Weight Over: 1.32 Shipping: 14.50
    Weight Over: 0.99 Shipping: 11.50
    Weight Over: 0.66 Shipping: 8
    Weight Over: 0.33 Shipping: 5

    And I had to add 1 more property, with weight over 0 pounds costing some minimal fee (in my case I just repeated the 0.33 dollar figure).

    Is there no way to change the default weight setting in WP E-Com?

    In any case, thank you VERY much for your help Lee, you’ve nailed it.

    Cheers

    Jeff

    • You’ve got it :)

      I suppose I should really let you specify the units in the weight rates, and seamlessly convert between them. If anyone wants to sponsor that work, or provide a patch I’d happily put it in – but otherwise it’ll just go on my rather long to-do list …

      Glad you’re enjoying the plugin.

    • Hi, if you want convert the weight into grams or other..
      frist check the convert table of weight on google..

      at the line 365 above of
      wp-e-commerce-weight-continent-shipping.php file
      after : foreach ($layers as $key => $shipping) {
      put ==> $weight=$weight*450;
      before: if ($weight >= (float)$key) { [....]

      in this case convert it into grams. If you want other weight check on table the conversion..

      i’m developing a new option on admin where can set the conversion table. Stay tuned here.

      very thanks to LEE for this plugin..

      • mistake..
        don’t put $weight=$weight*450;
        but under at the IF

        if ($weight*450 >= (float)$key) { [....]

        this is correct

        • WP e-Commerce already has a function that’ll convert all of the weight units it allows you to put products in with (Can’t remember the exact name at the moment!) – so you should use that to convert. If I was coding this up – I would store all values in a single unit (lbs), and use them to compare, but along with each rate store the unit the user put it in at so we can show their original units in the admin interface.

  6. Hi there,

    I am a bit confused by your second step:
    Next – you’ll need to create whatever regions you want in the wp_wpsc_region_tax table, using the ID you’ve just found as the “country_id” field, e.g.
    I am using phpMyAdmin to edit the database – when I look at wp_wpsc_region_tax table I can see fields for:

    id
    country id
    name
    code
    tax
    but I am not sure if I am meant to add a new field or edit one of the existing fields

    Thanks
    Chris

    • OK – so you need to find out the “id” from wp_wpsc_currency_list for the country you’re trying to split into regions. If it’s a standard install it should be the same as the example I show, e.g. 156

      Then if there are already regions in the wp_wpsc_region_tax table you’d amend them, but for New Zealand, I’m pretty sure there won’t be – so you’d need to add a new row for each region, using 156 as the “country_id”.

      In your case it’ll probably end up looking pretty much like this:

      Screenshot

      Although you’ll have three rows, not two if you’re also creating a region for Auckland.
      Hope that helps.

  7. Also – I installed your plugin (running WP v2.8.4 and WP-ecomm v3.7.6) and when I go to edit > settings > shipping I cannot see any of the shipping options anymore. Is this normal or do I have to make the above configurations to see the shipping options.

    Why I need your plugin:
    I need to create
    New Zealand: Auckland Weight Shipping Rates
    New Zealand: North Island Weight Shipping
    New Zealand: Sounth Island Weight Shipping

    Thanks
    Christine

    • No, that’s definitely not normal. My first thought would be a WP 2.8 incompatibility as I haven’t tested with that. Do you have any errors in your PHP error log – or javascript errors in the browser?

      • No errors in the browser – just heading with Shipping and blank screen below that. Will try upgrading to 2.9 and see if that fixes and will then get back to you

        Thanks for your time

        Christine

        • That definitely sounds like a PHP error which would indicate either:
          - a corrupt copy of the plugin
          - a bug in the code
          - or I’m calling a function which doesn’t exist on your system (ie a wp 2.9 only function, or maybe a PHP function you don’t have – are you on PHP 5?)

          Let me know how it looks after you’ve upgraded – although if you can find your PHP error log that would almost certainly tell you what the error was.

  8. Can I change the weight in other than “pounds”?

    • Not right now – you have to put all the weights into the shipping plugin in pounds. I could extend it to support other weights but I don’t particularly have time right now I’m afraid.

  9. hi, just downloaded your plugin and trying to figure out the database thing, but is it possible to this an easier way.
    I need: shipping & Weight for following region, and it should be sufficient for the customer to choose themselves between:

    norway (default)
    europe
    rest of the world

    We’re only selling t-shirts, and each is about 160 grams.

    do i have to do it the hard way ?:-)
    regards Chris

    • Since you’re not splitting an existing country into “regions” – you shouldn’t *need* to make any database changes.

      Just enable both of the shipping modules that the plugin provides, and use the “Weight / Country and Region” module to set the weight rates for Norway, and the “Weight / Continent” module to set rates for the other continents.

      Two notes:
      1. There is no “continent” called “Rest of the World” – so you’ll have to set the rates for each continent separately
      2. Users purchasing to Norway will get two rate options, one from the “Country” module, based on the rates you configure for Norway, and one from the “Continent” module, based on the rates you configure for “Europe” – but you said you’d be OK with that ;)

  10. Thanks, i’ve put in grams in the weight field, should i change anything in the php file? or is it enough to use grams the wp e-commerce settings?

    • WPEC converts all product weights into pounds – so the figures you put in the weight/region plugin have to be in pounds also – irrespective of what you choose when you create your products

  11. Hello Lee, Thanks for the great helpful plugins :) .
    I would like to ask is it possible to use multiple courier service for single destination shipping?
    e.g
    shipping 2 kg from “City A” to “City B” have 2 courier service available to choose:
    - courier X: price=$5, arrived about=4 Day
    - courier Y: price=$10, arrived about=2 Day
    I already have that courier price and arrival data and I want to combine it with your plugin.
    Any help greatly appreciated

    Regards

    • Not quite sure what you mean – but I think what you’d need to do is code up a custom shipping module. There’s a tutorial, and starting-point plugin here:

      http://getshopped.org/resources/docs/get-involved/writing-a-new-shipping-module/

      • I think what they want is to have the module duplicated so that the customer can choose the shipping type they want.

        At least, this is what I want for my site. :)

        Is there anyway to run two versions of the weight/continent module? I’ve tried editing it myself, but I end up with a blank site instead of a working one! At one point I got it working, but then I got an array error in the admin backend.

        I actually have it set to be a “flat rate” module by setting each item’s weight to 1 – this way the price changes based on how many items they’ve ordered.

        I just need to duplicate it so I can have a “first class” shipping and a “priority mail” shipping choices for the customer. Can you help?

        • Within wp-content/plugins/wp-e-commerce-weightregion-shipping, you’d have to:

          Duplicate wp-e-commerce-weight-continent-shipping.php
          Within your new copy:
          Rename the class to make it unique
          Change the “Internal name” set in the constructor

          Amend wp-e-commerce-weight-region-shipping.php to include your new file, and hook it in [Basically copy one of the existing blocks, rename the file and class names]

          • Thanks for your help! Maybe I’m doing something wrong.

            Here’s what I added to wp-e-commerce-weight-region-shipping.php (which kills my site and makes everything blank):

            /* FOR PRIORITY MAIL */

            require_once(“wp-e-commerce-weight-continent-shipping-priority.php”);

            function ses_weightregion_shipping_priority_add($wpsc_shipping_modules) {

            global $ses_weightregion_shipping_priority;
            $ses_weightregion_shipping_priority = new ses_weightregion_shipping_priority();

            $wpsc_shipping_modules[$ses_weightregion_shipping_priority->getInternalName()] = $ses_weightregion_shipping_priority;

            return $wpsc_shipping_modules;
            }

            I copied the original weight continent file and made it -priority.php, and changed the class name and internal name to match above.

          • All seems sensible. If you can find your PHP error log it should tell you what the error is – alternatively if you send me over a ZIP of the whole wp-e-commerce-weightregion-shipping folder I’ll have a look when I get chance …

          • Hi Lee:

            I got the duplication to work but unfortunately it modifies the same data base fields so I can’t actually have two different configurations for Express & Regular. Any suggestions?

            Cheers.

          • Ups… it seems that although I have the two shipping methods available in the admin panel only one shows in the checkout page. Strange as they have different internal names, class names and have been added with different names.

            I wonder why? :)

          • A little update in my investigations:

            When I try to configure the data for my “custom express method” (which is a copy of the weigt-country-region) the forms are filled with data from ses_weightcountryregion_shipping_options within the _options table.

            If I try to change them nothing happens in the _options table ( not in ses_weightcountryregion_shipping_options nor in ses_weightcountryregion_shipping_options_express )

            Is my will to get two different rates for the same country/region depending in the method I choose too complicated? (Both methods being actually the same but with just changed names)

            Cheers.

          • Hi,

            I took a look at the code you provided, and everything you’ve done looks OK. I think the problem is that the AJAX actions and DIV names aren’t unique (It doesn’t automatically pick up the revised internal name for these bits). So – when you pick the country and the form refreshes, it basically picks up the standard method, not your revised one – because your Ajax call is going to:

            admin-ajax.php?action=ses-weightcountryregion-layers[...]

            instead of the new one you’ve registered:

            admin-ajax.php?action=ses-weightcountryregion-express-layers[...]

            If you fix that link everything should work as you’re expecting.

          • Hello again Lee:

            After a few changes in *-express.php now I am almost there.

            It is actually working, but now there is a bug now with the “Shipping address same as billing address?” check button. When I click this checkbox the selected shipping method changes to the first one… I presume it is related with ajax again.

            Maybe the name of the divs or something like that are the same and the ajax gets confused.

          • I can’t see anything wrong that would cause this – the INPUT fields have unique names, and indeed I can’t reproduce this behaviour on my test box. What happens if you enable one of the out-of-the-box plugins as well?

          • It happens the same if I select other shipping methods as for example Flat Rate and Table Rate.

            Did you checked and unchecked the “Shipping address same as billing address” box three or four times running? That’s what is causing this behavior.

            Cheers.

          • Yes – I still can’t reproduce it on my test site.

          • Hi

            I know it is somehow related to the ajax.functions.php file as I modified the shopping-cart.php file so the output changes a little bit between them.

            shopping-cart.php –> 24h shipping
            ajax.functions.php –> 24h shipping- Choose a Shipping Rate

            I am really stuck in this one, could you please share your thoughts?

          • I can’t really help with this – it seems to be related to changes you’ve made as I can’t reproduce it with a standard build with your shipping code.

          • I decided to set up a brand new test box, WP3.0.1, WPecommerce 3.7.6.9 and your modified from 3.0 plugin version.

            Unfortunately I am still getting the same error… there is a public site where you can check it out (just grab a product go to the checkout page, select the second shipping method “Standar 24-72h” and click in the “Same billing addres” a couple of times and you will see the radio buttom from the shipping method selected jump to the other method…24h shipping)

            [Removed]

            I also created one in my local-host but no luck neither. I have even checked with different browsers because of my frustration.

            That’s becoming my own X-file.. hahaha

            You already deserve a beer so don’t hesitate you will get it anyway ;)

          • I *think* this is standard behaviour (Although no idea why it doesn’t do it on my test site!). wp-e-commerce.js calls submit_change_country() when shipping same as billing is checked. This causes shipping to be re-quoted, and therefore reset to the first option. So – it’s a wp e-commerce “feature” rather than anything you’ve done – or the plugin has done.

          • OK I see. Then the solution would be to store this parameter and send it to the new page as the rest of the data from the form? I am still not very confident with all this ajax thing.

          • Or – only call the change if the country *has* actually changed.

            The problem with sending the current selection is that if the user has changed the country then the pricing for the new country can look very different – and the option they had chosen isn’t necessarily right for them now – indeed it may well not even exist!

          • I don’t know how to do that (I am trying to do it), meanwhile I have opened a thread in the forum regarding this issue.

            http://getshopped.org/forums/topic.php?id=14138

  12. Hi,
    I want to customize my wpec theme, let’s say the shopping cart page. I want to display the shipping cost calculated by the plugin instead of the usual:


    <span class="pricedisplay" id='shipping_'>

    Can I replace wpsc_cart_item_shipping() with the plugin’s function to do that?
    I found get_item_shipping() but it doen’t work on my template.
    I get a Fatal error: Call to undefined function get_item_shipping()

    How do I call that from my template?

    I’m just getting $0.00 as shipping value on a per product basis.

    The shipping calculator works perfectly!
    Awesome Plugin!

    TiA.

  13. Hi would it be possible to set this so that it will be based on the total product price instead of weight for example:

    $0.01 to $20 = $10 shipping
    $20.01 to $40 = $25 shipping

    and so on? Any help would be greatly appreciated. Thanks!!!

  14. Thanks for the excellent plugin.. Was about to give up when I see standard WP e-commerce doesn’t have what I want for my local shipping requirement.. This should go into the standard plugin with WP e-commerce..

    Keep up the good work!

  15. Any results on adding several shipping options like Regular, Priority, or Express Shipping options for regions/continents to this plugin?

    I have been having a difficult time with finding a way to add these shipping options to WP ecommerce. By default there only seems to be a flat rate, one weight based rate, or one table rate. This plugin definitely makes it easier to get Canada rates separate from Europe, but it still offers only one shipping option – in my case International First Class Mail. What about Priority or Express?

    It would be nice if some of the shipping options at Mal’s ecommerce cart could be integrated into the plugin. They have the various shipping options and a weight based table that I set up to get USPS rates exactly. For example, you can set weights between 1 and 9 oz to go up $.25 an ounce and between 10 and 20 ounces to go up $.50 per ounce, and so on – I forget what they call that, maybe weight banding.

    What should work on WP ecommerce, the USPS calculator, doesn’t because it is not weight based. I still don’t get how that works. You can only send Priority Mail boxes or flat rate containers?

    Thanks for the plugin, Lee!

    • Hi Rick,

      I don’t have any plans to add multiple options per country/region/continent right now unless someone wants to commission the work and/or provide a patch :)

  16. Hi, I followed your directions above and changed the wp_wpsc_currency_list entry for new zealand but I can’t find a wp_wpsc_region_tax table anywhere. And newzealand is not showing up in the drop down menu of the admin area for the continent settings either.I’m using wp ver. 3.0.1 and wpec 3.7.6.7. Any ideas?

  17. Hi, it is possible that the plugin is adding wrong? The first shipping i add it’s ok, if i keep buying and adding products the shipping $$ doesn’t change. Any idea? Thanks!

    • Sure – it’s possible – although there are plenty of people using it successfully so I doubt it. The most likely cause is that you’re not entering the shipping rates in pounds (lbs) – which you have to do – no matter what units you’ve used for your products.

  18. Thanks Lee, I was relieved to find this plugin as it seems that it could do just what I need for http://www.s-89.cp.e-business.ie/products-page/:
    one set of prices by weight for Ireland
    another set of prices by weight for everywhere else

    I made Ireland it’s own continent as you did for newzealand above and am just using “Weight / Continent Shipping”. It doesn’t seem to be calculating the cost for more than one item.

    It’s also not changing the shipping when I increase the update the quantity in the shopping cart — but then maybe it is but the calculations not working?

    Before I made Ireland it’s own continent I tried just filling in the amounts for it in “Country and Region Shipping” and filling in the second set of rates for all the continents and use both settings, but that didn’t work either.

    Likely to be something simple I’ve overlooked (I hope.)

    Thanks, Ann

    • Hi Ann, as per my comments to Gabriel above – it’s likely that you’re putting in the wrong weights in the shipping config. The weight bands you configure in my plugin must be in pounds (lbs).

      • Thanks Lee for your time. I just testing width 2 products , Cartera1 200grs
        Cartera2 1500grs

        Rules:
        0->$10
        1->$20

        The rules are ok, if i bought cartera 1 it’s $10, if i bought cartera2 it’s $20. But if i choose cartera1+cartera2 or more than 1 model the number it’s not ok. I will try to test it this weeekend. Thanks a lot

        • Hi – sorry, but I’m completely confused about what you’re trying to achieve.

          200 grams is 0.44lbs, so I’d expect 1 unit of Cartera1 to be $10, 2 units of Cartera1 to also be $10 (0.88lbs in weight), but then 3 units of Cartera1 to be $20 (1.32lbs in weight).

          1500 grams is 3.3lbs – so any order containing one of more of Cartera2 (Together with anything else) would be $20.

          What exactly do you think isn’t working?

  19. Thanks Lee, I don’t think it’s the way I have the product weight added. I’m thinking of it as units to units rather than converting from grams to pounds. So for the product (I only have one for now), we put 180 pounds, and in the shipping settings for Ireland-
    Weight over: 539 Shipping: 3.00
    Weight over: 299 Shipping: 1.90
    Weight over: 0 Shipping: 1.35

    for all other continents-
    Weight over: 539 Shipping: 7.50
    Weight over: 299 Shipping: 4.25
    Weight over: 0 Shipping: 3.00

    Those weights are actually reflective of grams, but I assumed that if you enter the same in both places as pounds the calculations should work.

    I’m thinking unlikely, but any chance the plugin isn’t compatible with the theme? I’ve had that with certain widgets. I’m using Genesis.

    • So what exactly doesn’t work?

      Can you send me some details of the site privately so I can take a look? http://www.leewillis.co.uk/contact/

      • I sent a message. Thanks for your help.

        • I’ve replied. The problem is that your products have variations, and although you’ve set the weight against the product, the variations have been left with a weight of zero, hence the pricing not going up. If you add weights to each of the variations, then it’ll all start working as expected.

          • Brilliant! All working now! Because the weight area for variation is under ‘more’ I didn’t realise it was even there – and then I thought you only put the additional weight! Now I’ve got that you have to input the total weight for each variation (just like you need to put the total price). Thanks so much!

  20. Another question a little off topic, but you may be able to point me in the right direction. Is there a plugin that will limit the amount a customer can purchase – just because you don’t want to add an infinite number of weight bands in your settings? :-)

    • No – there isn’t right now – but in future versions (3.8 onwards) you can set the rate to be a % of cart total, so you could make your final band be a %-age rather than a fixed amount …

    • Not that I know of – although I’m sure one could be written …

  21. Lee, now i see that it’s not an error, I think Ann’s problem could be the same concept error that i had. Now i see that the shipping charge is applied to all the products you bought as one, what is logic if you send all the products in one box like if they were one product.

    But what if the shop owner wants to handle the products apart? Now is like this:

    item1->weight=1
    item2->weight=2
    item3->weight=1
    Total Weight -> 4 -> xMoney

    But if the shop owner wants something like this?

    item1->weight=1 ->xMoney
    item2->weight=2 ->xMoney
    item3->weight=1 ->xMoney

    Total item1->xMoney + item2->xMoney + item3->xMoney

    • Ah, right – yes. There’s a single lookup based on the entire cart weight. If you want to lookup charges for each item based on weight, and have all of the charges added up you’d need to change how the plugin works. Basically inside of the getQuote() function you’d need to loop through the cart and do a lookup for each item, instead of just using the cart total weight (via wpsc_cart_weight_total).

      • We calculated the weights/rates for the table based on the total amount of the cart not per item. We only have one product at the moment so pretty easy :-)

      • I’ve found the relevant getQuote section in the wp-e-commerce-weight-countryregion-shipping.pho file but a steer on how I’d adapt it to get the loop through rather than total weight would be appreciated. My php skills are basic to say the least.

        Pete

        • Code something like this will loop through each cart item:

          if (isset($wpsc_cart) && isset($wpsc_cart->cart_items) && count($wpsc_cart->cart_items)) {
          foreach ($wpsc_cart->cart_items as $cart_item) {

          // Do something with $cart_item here

          }
          }

  22. thanks Lee, it really works for me.”regions and charge shipping differently to the different areas in WP E-Commerce”. Nice explaination. Great..

  23. Hi Lee,

    I seem to have a problem with this plugin.

    First just to make sure. I install in in the wp-content/plugins directory correct?

    Secondly, it shows “Manage Regions” and just says Australia and New Zealand no matter what I change.

    Third, there are no extra options under Settings>>Shipping

    It has the standard “Weight Rate, Flat Rate & Table Rate”

    I have not configured the database yet so do I need to do this in order for the options to show? As I do not want to add regions and the WP-Ecommerce” Weight Rate is broken for me.

    Using 3.7.6.7 WP-Ecommerce, Your Plugin 3.0, VS 3.0.1 WP.

    Thanks

    • Secondly, it shows “Manage Regions” and just says Australia and New Zealand no matter what I change.

      The countries shown are based on the “Target Markets” you’ve selected in the WP e-Commerce settings, under Store > Settings > General. If you want additional countries you’ll have to allow them as target markets, then they’ll become available.

      Third, there are no extra options under Settings>>Shipping

      That’s a bit strange – if you drop me a note via the contact form I’ll see if I can debug this for you.

      WP-Ecommerce” Weight Rate is broken for me

      Surprised to hear that – there aren’t any issues with that as far as I know, and if that doesn’t work then I’d be surprised if mine does, unless there some misunderstanding somewhere about how to configure it. When you drop me an email if you include some details about what you’re trying to do and I’ll see if I can clarify – we’ll certainly try and get my plugin up and running…

  24. Hi Lee,
    First of all thank you very much for all the work you do in the forums helping with your answers.

    I am using your plugin “wp-e-commerce-weightregion-shipping v3.0″ which I understand is just the continuation for what you explain here in this post.

    I am using WP 3.0.1 and WPEC 3.7.6.9 and they are not working as I expected together. Let me explain you:

    I have three countries in my target markets list (Spain, France and Andorra). Sapin which is my Base Country has three regions (Let’s say A, B and C for simplicity’s sake).

    I set up the taxes for each one of the regions but unfortunately when I proceed to checkout I can’t see the taxes nor adding nor showing in the table.

    Please note that when I do not use your plugin taxes work fine but then I can’t use your regions feature.

    Any help would be very much appreciated. If you wish me to move this thread to the forum instead of using your blog just let me know and I will open it there.

    Regards.
    Javier.

  25. I forgot to mention a couple of things that it may be helpful.

    1) When deactivating the plugin I still have the regions dropdown in my checkout page to select one. (They weren’t before and now the taxes calculation do not appear anymore)

    2)Checkout settings page options:
    Lock Tax to Billing Country: YES
    Disregard Billing State for Tax Calculations:NO
    Enable Shipping Same as Billing Option: YES
    Use The Billing country for Shipping unless a shipping form is present: NO

  26. It’s me again, sorry about the chain of comments. Just to let you know that I activated your plugin again, deleted the regions and the tax calculation using your shipping method works fine (flat rate also is working fine again).

    Thanks in advance.

  27. So, is there any way to get the taxes working with regions?

    Cheers.

    • Hi Javier,

      Taxes and regions are a core part of the plugin – it’s not like we’re doing anything special here in my plugin – so I guess this is just a consequence of how regions are implemented in WP e-Commerce. Best bet would be to post on getshopped.org/forums and see if anyone’s come across this before and/or has a solution.

      • Hi Lee,

        Thanks for your answer. Please could you further explain what do you mean by “how regions are implemented in WP e-Commerce”? I thought regions where only available because of your plugin and therefore not related to the wp-ecommerce plugin itself.

        • No – regions are a standard part of WP e-Commerce – my plugin just makes it easy to add and amend then, and to set shipping rates by region, not just country.

          • I have just realized that the regions from USA (they are there by default) work fine so taxes are added depending on which one you select. Unfortunately the regions added with your plugin don’t seem to work.

            Maybe the plugin is missing something to add to the DB.

            Regards.

          • The entries in the database look right (The code for managing regions wasn’t actually coded by me – in was contributed by another developer). I suspect that somewhere in the code there are special cases for USA (& the other countries that have regions out-of-the-box). As I said earlier, the best bet is to ask around on the GetShopped forums …

  28. Cheers Lee, I appreciate your help. I am heading off to the forum now :)

    Javier.

  29. If I’m only selling in the UK I presume I don’t need to fiddle about with the database?

    Anyone had issue with the Tax ‘breaking’, despite entering the correct amount in the regional breakdown on admin’s Setting >> General Settings.

    Workround seems to be to put custom tax rate against all products in the shop but this won’t be fun in January next year when VAT goes up.

    Pete

  30. This plugin just rescued a project for me. THANK YOU!

  31. Hi Lee, i would like to know how to translate this plugin of yours, i tried with the codestyle localization http://www.code-styling.de/english/development/wordpress-plugin-codestyling-localization-en but it recognizes everything but the translation of the plugin WP E-commerce and of course your plugin, in fact i have translated myself the file for the main plugin and it works but when i installed yours some voices are not translated and some yes, in the directory i cannot find any .po or .mo, can you tell me which files i have to edit or how i can find them?

    PS: thank you for the great effort you apply to help people.

    • Hi – I’m afraid I know nothing about localization. If someone can point me at a guide on how to make a plugin localization-ready I’ll happily get on with it (At some point!)

  32. hi lee,

    thanks for the plugin..
    I was able to change the settings for the continent of my chosen country to take it out from asia continent.

    However, I cant figure out how to create the regions I need in the phpadmin Table: wp_wpsc_region_tax

    There are regions there for usa states but I dont know how to make my own. Please help me.thanks a lot.

  33. hello lee,
    The “code” column at “wp_wpsc_region_tax” is 2 character lenght, can I change the structure to 3 character lenght?
    Thank’s

    • I’ve no idea how well that would work to be honest. I’m fairly sure WP e-Commerce would try and “fix” it next time you upgraded, and I think perhaps it’s used in some places that expect it just to be two digits. Not sure why you want to extend it as it’s mainly used internally and isn’t really customer facing?

      • I use it because I want to enter lot of city and the code is not enough if only use 2 character.

        • And they all need their own Region? None of them share a shipping charge?

          Even if you do, then the two characters that are there can give you an awful lot of cities (> 520 if you do a1,a2,a3…,b1,b2,b3…,z1,z2,z3…,1a,1b,1c…,2a,2b,2c…)

          If you’re setting up that many I suspect there’s a better way to build it (Does the shipping company not offer an API or similar?)

          • you’re right mate!, 2 letter combination is enough, and when I closely see the rates, it’s had similarity. Poorly the shipping company didn’t offer API for their shipping. So I must enter it manually :( .
            Thank’s

  34. Hi I’ve installed your plugin and followed the steps above but there are no extra options showing under Shipping > Shipping Modules > Internal Shipping, so I can’t go any further. I’ve noticed a couple of people above have reported similar issues – did you resolve them?

    I am running WordPress 3.0.1, WP E-Commerce 3.7.7 and WP E-Commerce Weight & Destination Shipping Modules 4.1 (also installed WP E-Commerce Shipping (Country, cart amounts) 1.0 but disabled now to see if that was causing a conflict).

    Please help!

    • Hi – are you using Gold Cart 2.7 by any chance? It has a bug which prevents external shipping modules being loaded correctly – that’s the only reason I know of that it might not work.

      To fix it, simply edit gold_shopping_cart.php and comment out, or remove the line that says:

      include_once(WP_CONTENT_DIR.’/plugins/wp-e-commerce/wp-shopping-cart.php’);

  35. Hi!

    I was having the same problem as Tony! (Frankly, this whole process has been one problem after another! Gold-cart is buggy as hell and I’m not a coder so it takes hours to find solutions).

    Thanks for the plugin and the excellent support! Now that I have it installed, I may actually be able to get my shop up and running in the next couple of days. That is, assuming I don’t run into any more bugs from the getshopped side of things. Is it just me or is this stuff really hard to use?!

    Thanks again!

  36. Is there any way to combine countries into one region? Rather than pricing each country in Europe individually, can I combine them and set one price for the whole region? I know you offer continent shipping but our shipping quotes include Canada in their Europe, and USA has its own rate (for some reason). We’re using Express Mail Service from Korea Post to ship and their lists are set up for their convenience, not ours, obviously!

    Any advice?

    • You can just move the countries into whatever continents make sense for your shipping requirements. As far as I’m aware the “continent” information is never shown to the purchasing user – so they don’t need to match reality. The article covers how to change which continents countries are assigned to.

      • Thanks so much for your help. Now it seems so obvious! I’ll have to try it tomorrow, but I’m sure I’ll be able to follow your instructions in the article (I also just found some comments you left on the e-commerce forums).

  37. Hi Lee,

    I think I’ve found a bug in your plug-in or the combination of your plug-in and a feature of WP E-Commerce.

    There is a conditional statement in the shopping_cart_page.php that checks if a billing form is available or shown:

    wpsc_has_shipping_form()

    If the above check returns false, your plug-in fails to look for the right shipping method or region, and thus fails to calculate shipping cost.

    This is all I can say based on the little knowledge that I have of your plug-in and WP E-commerce. This problem can be reproduced using the default theme of WP E-Commerce, the Country/Region shipping method and the option “Enable same billing address as shipping address” enabled.

    • My plugin doesn’t really control how the checkout controls. Like any other shipping plugin – it simply provides the core of WP e-Commerce with a list of options and prices, so I suspect it’s a WP e-Commerce bug – if indeed there is a bug. With the setup you described I can’t see any issues here.

      Can you clarify what exactly you do, step-by-step, what you see, and what you’d expect to see instead?

  38. Hi Lee,

    I installed your plugin (it’s exactly what I need to fix this project), but the options are not appearing on the Shipping options page. I don’t see the two checkboxes.

    I’m using e-Commerce 3.7.7, WordPress 3.1, and version 4.1 of your module. Nothing.
    Any idea on why it’s not showing up?

  39. Hi Lee.

    Am I crazy or are the calculated shipping costs not added to the total of the order in WPSC?

    If I select a shipping quote, the quote shows, but it doesn’t add to the total. If the user then proceeds to checkout and payment, the shipment quote is not part of the total.

    I am using Weight / Country and Region Shipping and the quote is based on the total sum of the cart’s weight.

    Is this normal behavior? And if so, how am I supposed to charge the user with the shipping?

    • It should add it in automatically – you’re certainly the first person I’ve come across that says that id doesn’t – do you have a link to your site?

  40. On another note, is there a way to skip the destination selection form, if only one destination is configured? We’re targeting one country/region, which has a single set of shipping layers. I’d like to save the user the trouble of clicking “Calculate” when there is only one option anyway.

    I am almost contemplating hitting Calculate for the user, by doing a $(“form#change_country”).submit(), but that seems like the wrong approach.

  41. Is it possible to alter this so that it uses the flat rate from WP-ecommerce + Regional shipping?

    I need regional shipping for a few locations everything else Flatrate.

    Cheers,

    Aravona

  42. Hi Lee,

    I’d say a good add to your plugin would be a “Manage Country Groups” section. So you could easily make your own “continents” without having to edit the mysql tables by hand.

    Just an idea. Thanks a lot for your cool plugin.
    Javier.

    • You’re right of course. The region management code was kindly contributed by Instinct which was a welcome addition, but having the same for grouping countries into continents would also be useful.

      Happy to accept patches, but I don’t really have time to add it in myself right now.

  43. I had a look at this, I think you also replied to me on getshopped forums.

    I get php, however I’ve no clue how to set the module up and the tutorial doesn’t really explain much.

    I’ve started my class and added in the function they state.

    However, I’ve spoken to the people that want the site and they want, if someone adds in a postcode in their list, to get the user directed to a phone number/email. I think perhaps it would be better for me then, instead of a shipping module (since they changed their minds) to put a javascript / php code into the shopping cart?

  44. Hello,
    Thanks for developing such a useful plugin.

    I have an issue with the plugin that I can’t seem to resolve. I’ve followed the steps above and broken Ireland into two regions. It appears to be working on my staging server but on the live server it is showing two shipping options when Ireland is selected.

    It shows
    “Weight / Country and Region Shipping- Choose a Shipping Rate ”

    Then it shows
    “Weight / Continent Shipping- Choose a Shipping Rate”

    The second option has a value set to 0. I can’t figure out why this second option is coming up as it is not coming up on the staging server. To be clear I don’t want this second option to appear because it is allowing users free shipping.

    Any help you can provide would be gratefully received.

    Best Regards,
    Derek

    • You’ll get this if you configure a 0 value for the content that Ireland belongs to. To resolve this, go to Store > Settings > Shipping.

      Click “edit” next to “Weight / Continent Shipping”, choose the correct continent, and remove the 0 in the weight bands.

      Or – if you’re not using weight/continent shipping, just untick it and hit update.

      • Hi Lee,

        Thank you for your prompt response.

        I tried removing the 0 from the “Ireland” continent and it hasn’t made a difference. There are still 2 shipping options for when Ireland is selected for shipping. The “Weight / Continent Shipping- Choose a Shipping Rate” being 0 and allowing free shipping.

        Have you any other suggestions that might help.

        Best Regards,
        Derek

  45. Hi,
    I’m designing a website for a client who’s selling garments.
    The client is based in Australia.
    Requirements are:
    - Customers can log in and have the garments shipped to the following areas: Australia, New Zealand, Zone B (Asia Pacific, Zone C (USA, Canada, Middle East) or Zone D (rest of the world).
    We’ve got the shipping prices that we would like to use.
    But is it possible to calculate the shipping on basis of the weight of the garments?
    And also, on orders over $99, the shipping is free (Australia only)

    I’d set her account up in Paypal, but Paypal in Australia doesn’t allow for you to calculate postage on basis of weight.
    Neither can you set up different payment options (Australia, NZ, rest of the world etc.)

    Massive limitations!
    Will this plugin do all these things possible via Paypal?

    • Based on what you’ve said it sounds like it should. Install it and give it a whirl!

      • And you were right!!!
        It does indeed work.

        There’s only one small thing which I can’t figure out.

        For Australia only customers, there will be free shipping on orders over $99.

        I’ve enabled the free shipping bit, but it does it worldwide.
        How do I enable it so it’s ONLY for Australia?

        (and no, I don’t know anything about coding…if there’s any coding involved, do you mind telling me where exactly to insert it?)

        Thanks again heaps for your blog! Without this post, I wouldn’t have known about WP E-Commerce.

        • I don’t believe there’s any way to limit that to Country (or continent or region) in the default product, and it’s not code I’ve looked at much I’m afraid. If you want me to take a look at this drop me a note on the “Contact” page and we can see what we can work out.

  46. Is it me, or does it seem strange that after a couple of years of people pointing out the buggy and incomplete functionality of the USPS shipping with wp e-commerce, someone out there would have nailed the fix for doing correct weight based shipping for priority and parcel post amongst others.

    Am I missing something? I would simply like to implement the proper calcs for domestic USPS. This module doesn’t quite seem to nail it either.

    Where to turn? What to do?

    • Hi,

      This module certainly isn’t meant as a replacement for USPS – I’m not in the US, and nor is the site it was originally developed for!

      Although I don’t pay much attention to USPS threads, my general observation is that people have problems getting it set up and configured right, but generally I thought it worked. Certainly I don’t think the core devs are of the opinion that it’s “broken”. If you have a test site or similar, then I’d suggest trying out the new 3.8-beta and feed back if you’re still seeing problems there:

      http://getshopped.org/news/wp-e-commerce-3-8-public-beta/

  47. Tahiti (or French Polynesia) isn’t part of the country list. Is this easy to add?

  48. Customers are forced to put a postcode into the postal code field.
    But there’s a few countries out there who doesn’t use postal codes (Samoa, as an example).
    Is there a way around this (apart from entering random numbers)?

    Also, if I want to add the line “please enter 0000, if you country does not use postal codes”, under CALCULATE SHIPPING PRICE, is there a straight forward way to do so?

  49. Lee, it’s me again. I upgraded my WPEC plugin, edited my goldcart and now I can use your sweet plugin already. yay!!! Salamat!

  50. WP Ver: 3.0.4
    WPEC: 3.7.8 (Free Version)

    I would like to set the minimum shipping rate at $5 on all shipped purchases, but if the USPS (using the WPEC API) rate is higher charge that amount, that I only ship to CONUS. And an option if the customer picks up the product in the store, no shipping charge. The no shipping charge is not crucial, but the minimum/base charge is more important.

    This shipping rate scenario is for tangible products and not down-loadable products.

    Is this possible within WPEC or the Gold Card and your plug-in?

    • My plugin isn’t going to help you get real time quotes from UPS and charge the minimum fee.

      I’d say you have two options:
      - Get a list of USPS rates for shipping to CONUS, and use my plugin to set up the weight rates – so you’re charging against set weight rates rather than a dynamic USPS quote [Assuming you don't need to take into account things like box size]
      - Take a copy of the USPS module, and customise it so it returns $5 if the quote from USPS was less than $5

      For the no shipping charge set one up using this plugin http://wordpress.org/extend/plugins/wp-e-commerce-fixed-rate-shipping/

Leave a Reply

Required fields are marked *.

*