How to Use Weight Based Shipping For Multiple Flat Rates

Written by in Tutorials on May 13, 2013  |  24 Comments

how-to-use-opencart-weight-based-shipping-for-multiple-flat-rates

Do you want a second (or third, or fourth) flat rate for your site’s shipping? OpenCart doesn’t include a shipping method that allows for multiple flat rates by default, but you can easily set up multiple flat shipping options using the built-in Weight Based Shipping extension.

1. In System > Localisation > Geo Zones, set up a duplicate geo zone for each flat rate that you want. For example, if you wanted these three shipping options available to the U.S.:

  • Standard: $5.00
  • Express: $12.00
  • Next-Day: $18.00

then you would create three geo zones all with United States selected as the country, named “Standard”, “Express”, and “Next-Day”.

how-to-use-weight-based-shipping-1

2. In Extensions > Shipping > Weight Based Shipping, create a rate for each geo zone with a rate (in the format Weight:Cost) like so:

RATE #1

  • Geo Zone: Standard
  • Rates: 999999:5.00

RATE #2

  • Geo Zone: Express
  • Rates: 999999:12.00

RATE #3

  • Geo Zone: Next-Day
  • Rates: 999999:18.00

Don’t forget to enable the extension as a whole in the “General” tab, and each geo zone in its own tab. If you have other geo zones for other purposes (such as the “USA” and “United Kingdom” geo zones in the example screenshot) then leave those disabled in their tabs. If you need a tax rate applied to the shipping costs, then select the Tax Class in the “General” tab.

how-to-use-weight-based-shipping-2

3. During checkout, each option will be presented to the customer on the “Delivery Method” step. They are ordered alphabetically by name, so if you need them in a particular order then you should name them accordingly.

how-to-use-weight-based-shipping-3

4. If you want to change the name of the shipping method heading, you can do so in /catalog/language/english/shipping/weight.php . If you want to remove the cart weight that is attached to each rate title, then you can make the following edit:

IN:
/catalog/model/shipping/weight.php
REPLACE:
$result['name'] . ' (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
WITH:
$result['name']

And that’s it! Your OpenCart store now has multiple flat rate shipping options for your customer.

Tags: , , ,

About the Author

Johnathan Shaw has been working with OpenCart since 2009. He is the owner of Clear Thinking web development and runs OpenCartX, the curated OpenCart extension marketplace.

View all posts by

24 Comments on "How to Use Weight Based Shipping For Multiple Flat Rates"

  1. apostolos January 21, 2016 at 7:35 pm · Reply

    Hi , Thank’s for the tutorial. I want to ask you if I can desapear the “Flat rate” from displaying.
    If I disable or unsinstall from admin the OC can’t calculate give me error….
    Any idea?

  2. anuj April 12, 2015 at 11:15 am · Reply

    I Want add Shipping Charge In Price and Show Them On Product Page In Price. How I Do This..?
    Example :- Product Price Is 100$
    Shipping Charge is 5$
    Now I Want To Show Product Price 105$ On Product Page As Price.

    Thanks In Advance.

  3. STC February 1, 2015 at 5:02 pm · Reply

    Hi,

    Sorry, I’m new to FTP and such, but how do I change the name of the shipping method in weight.php file? Which part should I edit? Thanks in advance!

  4. Raluca Terente December 31, 2014 at 11:47 am · Reply

    Hello,

    This is a wonderful and easy to follow tutorial. However, I have a constant problem. I followed all the steps but still this shipment method does not show up during checkout. I’ve enabled the extension as a whole in the “General” tab, and each geo zone in its own tab. Could you give me some advice?

    Thank you in advance!

  5. Amelia July 3, 2014 at 11:32 pm · Reply

    Thank you so much for this!! Worked perfectly.

    Except this bit to remove the displayed cart weight -

    IN:
    /catalog/model/shipping/weight.php

    REPLACE:
    $result['name'] . ‘ (‘ . $this->language->get(‘text_weight’) . ‘ ‘ . $this->weight->format($weight, $this->config->get(‘config_weight_class_id’)) . ‘)’,

    WITH:
    $result['name']

    SHOULD REPLACE WITH:
    $result['name'],

  6. Kati June 27, 2014 at 10:51 am · Reply

    Thanks a lot!!! This helped a LOT!!!! Thanks for sharing!

  7. Johnathan Shaw January 31, 2014 at 12:14 am · Reply

    The tutorial should show you how to do that. You would create the appropriate geo zones (12 for standard, 12 for express) and then enter the rates appropriately. You’d essentially have 12 duplicates of geo zones, so that two options appear during checkout for each geo zone.

  8. Alex January 30, 2014 at 10:24 pm · Reply

    i meant to say weight based shipping. how do i create two diff weight based shipping, each having different zones

  9. John January 22, 2014 at 8:40 pm · Reply

    To work properly you need to assign a weight to every product. If it is not set you’ll get an error when checking out.

    I have just discovered this. Thanks for the tutorial.

  10. Johnathan Shaw December 17, 2013 at 7:03 pm · Reply

    If you only want Express showing, then setting its “Status” setting to “Disabled” in the Weight Based Shipping admin panel.

  11. Amit Vaid December 17, 2013 at 6:58 pm · Reply

    if i add deliervy address Geo Zone: Express then i want to show only Geo Zone: Express shippping cost bez i pay for this zone shiping then why show all how it possible

  12. RebeccaG November 13, 2013 at 10:25 pm · Reply

    This was amazingly helpful - especially when you’re dealing with multiple regions and rural delivery options. Thank you SO much.

  13. jan September 5, 2013 at 6:23 am · Reply

    Thanks ! Now it works - I was deleting that last comma right after square bracket - that was the problem .

    • Renwick March 8, 2014 at 7:55 am ·

      what this warning mean?Warning: rreqiue_once(home/test/public_html/system/startup.php) [function.require-once]: failed to open stream: No such file or directory in /home/test/public_html/admin/index.php on line 19Fatal error: rreqiue_once() [function.require]: Failed opening rreqiued home/test/public_html/system/startup.php’ (include_path=’.:/usr/lib/php’) in /home/test/public_html/admin/index.php on line 19

  14. Johnathan Shaw September 4, 2013 at 9:17 pm · Reply

    My last comment should read:

    …the browser is rendering > as > ; which…

  15. Johnathan Shaw September 4, 2013 at 9:14 pm · Reply

    Hi Jan — that error means you didn’t do the edit correctly. Make sure you follow it exactly — I recommend using the “Find” function of your text editor to make sure you’ve selected precisely the correct text. Right now, it looks like the browser is rendering the > as > which it should be doing, so you may need to do that to make sure you have the right line. Once finished, the line should read:

    ‘title’ => $result['name'],

  16. jan September 4, 2013 at 7:34 pm · Reply

    Hi
    Everything works like a charm but when I want to remove cart weight I get this error

    Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘)’ in /home/content/31/11535131/html/catalog/model/shipping/weight.php on line 46

  17. Jill August 29, 2013 at 6:44 am · Reply

    Many thanks, saved me a lot of time.

  18. Andrew July 11, 2013 at 10:45 pm · Reply

    Great tutorial! Really a great hack that you’ve come up with here.

  19. Philippe June 26, 2013 at 6:35 pm · Reply

    Many, many thanks…too simple that I was looking for a module…

  20. Şahin June 23, 2013 at 8:36 pm · Reply

    Thank you.

  21. Dave June 11, 2013 at 1:21 pm · Reply

    Thank you very much for this! It was way simpler than trying to make a module work somehow.

  22. Ronald May 31, 2013 at 7:04 am · Reply

    Thank you so much for this tutorial.

  23. Heru May 17, 2013 at 7:40 am · Reply

    Nice tuts. Thanks Jonathan

Leave a Comment

comm comm comm