Post by Meggles » Tue Apr 16, 2013 7:30 am

Hey guys

I'm using Jonathan's tip for using "weight based shipping" to create multiple flat rates.

I have two geo zones named Express and Registered.

Express is coming up first in the options because it's alphabetically first, but I want it to be second as it is the more expensive option.

Anyone know how to do that?


Thanks :)

Newbie

Posts

Joined
Sun Apr 07, 2013 10:27 pm

Post by Johnathan » Tue Apr 16, 2013 10:15 pm

The easiest way around this would be to use something like Multi Flat Rate Shipping, but if you don't want to use a commercial extension, you'd need to modify how the geo zones are pulled from the database. This edit may (or may not) work:

Code: Select all

IN:
/admin/model/localisation/geo_zone.php

REPLACE:
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY name ASC");

WITH:
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone"); 
That should order them by the way they are entered in the database, however it will change everywhere that the geo zones are pulled.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by Meggles » Wed Apr 17, 2013 7:04 am

Hi

Thanks for that - Express still comes up first in the options, unfortunately.

There's no option for "sort order" in the admin panel for geo zones so I guess that's why.

Just realised I can probably leave the original code and change ASC to DESC ?

Newbie

Posts

Joined
Sun Apr 07, 2013 10:27 pm

Post by Meggles » Wed Apr 17, 2013 7:11 am

Hmmm, no go.

Newbie

Posts

Joined
Sun Apr 07, 2013 10:27 pm

Post by elviscat » Wed Aug 14, 2013 6:54 am

Hi, Did you ever manage to get to the bottom of being able to order the Geo Zones?

Thanks

Newbie

Posts

Joined
Sun Jun 23, 2013 12:43 am

Post by SGT » Fri Mar 12, 2021 3:26 pm

I just had the same problem as above with "Weight Based Shipping". Here's how I worked around it (Opencart 3.0.2).

Edit the "...catalog/model/extension/shipping/weight.php" and change line 8 from

$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY name");
to
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "geo_zone ORDER BY date_modified");

Now in the admin dashboard go to System>Localisation>Geo Zones and click edit and save on each Geo Zone in the order that you want them displayed.

Pinball LEDs here: https://www.scribblygum.com.au


User avatar
SGT
Newbie

Posts

Joined
Wed Apr 25, 2018 10:08 am
Location - Australia
Who is online

Users browsing this forum: No registered users and 37 guests