Zen Cart Logo
Forums / Addon Shipping Modules / ZipShip - Support Thread

ZipShip - Support Thread

Views: 53,121

Results 41 to 60 of 109
18 Jan 2020, 1:46 AM
#41
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
284
Plugin Contributions:
1

ZipShip - Support Thread

using 156c

Hi

I've found a bug with the latest zipship. Most of my postcodes are 4 digits long, however because some postcode areas are so big I split them by adding a suffix to them, eg I have 6056 charged at $30 and 6056A charged at $35.

I've just discovered that the "A" is getting chopped off and my 6056A is displaying as "6056" and charging $30.

Thanks.

18 Jan 2020, 1:50 AM
#42
royaldave avatar

royaldave

Zen Follower

Join Date:
Aug 2013
Location:
Perth, WA, AU
Posts:
284
Plugin Contributions:
1

Re: ZipShip - Support Thread

OK, I checked my old version of zipship and noticed this -

//$this->dest_zipcode = substr (strtoupper ($order->delivery['postcode']), 0, ENTRY_POSTCODE_MIN_LENGTH);

        $this->dest_zipcode = strtoupper ($order->delivery['postcode']);

Assuming I made this change myself in the past, although I don't remember!!

18 Jan 2020, 11:47 AM
#43
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

royaldave:

OK, I checked my old version of zipship and noticed this -

//$this->dest_zipcode = substr (strtoupper ($order->delivery['postcode']), 0, ENTRY_POSTCODE_MIN_LENGTH);

        $this->dest_zipcode = strtoupper ($order->delivery['postcode']);

Assuming I made this change myself in the past, although I don't remember!!
That would be my assumption, too. When I'm marking up Zen Cart (and plugin) files, I normally bracket *my *changes with //-bof and //-eof comments with the date.

That way, when I'm upgrading I *know *to review (and possibly carry over) the change.

30 Mar 2020, 12:36 AM
#44
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: ZipShip - Support Thread

I used to use auspostcode Shipping UK Postcode Shipping version 1.3 Modified for australian postcodes by Alan McKenney - www.alphaweb.com.au. It died.

Luckly found Zip Code. I have couple of questions:

1: Where does the post codes entered in admin are stored? what is the file called so I can save it.
2. In Australia we have 4 digit post codes (zipcodes) , do I need to change line

if ($zipcode_table === '00000') {
```  to 4 digit  ```
if ($zipcode_table === '0000') {
```  will it make any difference? Min value already set to 4 digit.
3. Is there a way I can hard code the post codes in postcodes (ZipCodes)?  I was able to do that in auspostcode. See below

//NSW STARTS HERE
if ($i == 2) {
$default_postcodes ='2740,2741';
$default_value = '100:19.95,10000:0.00';
$description = 'NSW';
}

//QLD STARTS HERE
if ($i == 3) {
$default_postcodes ='4000,4001';
$default_value = '100:8.95,10000:0.00';
$description = 'QLD';
}

etc etc;.  up to 18 Zones. I have tried changing ' $default_postcodes'  to ' $default_zipcodes'  but did not work

Currently I have 18 zones working with ZipCode without the  zone descriptions.


4. I have 18 zones, how can I name each individual zones so I can see the zone names in admin in order to identy when making changes. Again this was possible in auspostcode.

5. I need to make certain items below a certain amount of free shipping to certain postcodes. 


This was possible in auspostcode like 

if ($shipping == -1) {
$shipping_cost = 0;
$shipping_method = MODULE_SHIPPING_AUSPOSTCODE_UNDEFINED_RATE;
} else {



How can I make say a local postcode 4214 and order is over $100.00 to show  'Enjoy orders above $100 shipped FREE to your area'  and add no shipping?




in auspostcode in languages English Mod Shipping >

define('MODULE_SHIPPING_AUSPOSTCODE_UNDEFINED_RATE', '<span style="color: grey; font-weight:bold;" >Enjoy orders above $100 shipped FREE to your area</span>');
\


I appreciate if someone has a solution for the above
30 Mar 2020, 12:19 PM
#45
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

  1. The post/zip code list(s) are stored in the database. You can change from the default of 3 zones by editing the zipship.php shipping-method (as identified in its readme).
  2. No need to change that '00000' to '0000', it's just a marker value (since that's not normally a valid zipcode).
  3. No need to 'hardcode', the zipcodes are configuration settings.
  4. There's currently no support to "name" each selection.
  5. ZipShip isn't as fancy as auspostcode: there are no free-shipping considerations.
30 Mar 2020, 1:02 PM
#46
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: ZipShip - Support Thread

Oh no.. this is a heart breaker. No free shipping?.
I hope someone can come up with solution. This is really really needed. Damn so close yet so far away.

Still a great module :-)

4 Dec 2020, 5:28 PM
#47
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Has anyone get this to work for Canadian postal codes which are alpha numeric.

4 Dec 2020, 6:27 PM
#48
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

allmart:

Has anyone get this to work for Canadian postal codes which are alpha numeric.
What version of ZipShip and what version of Zen Cart?

What's "not working"?

Would you also post the settings applied to ZipShip for review?

4 Dec 2020, 6:39 PM
#49
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Hi lat9,

I have yet to install it, just wanted to know if it work with Canadian postal codes before trying. So it should work?

Thanks

4 Dec 2020, 7:08 PM
#50
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

allmart:

Hi lat9,

I have yet to install it, just wanted to know if it work with Canadian postal codes before trying. So it should work?

Thanks
***Should ***is the operative word!

7 Dec 2020, 10:23 PM
#51
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Don't know if this mod will do what I want. We deliver with our own trucks locally and want to charge extra for locations with postal codes that are farther away. So all customers in our area pay $10.00 shipping and others by specifying the postal codes pay $15.00. Hopefully i don't have to enter all the postal codes in my area and hoping that there is a default setting.

Thanks!!!

8 Dec 2020, 11:31 AM
#52
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

allmart:

Don't know if this mod will do what I want. We deliver with our own trucks locally and want to charge extra for locations with postal codes that are farther away. So all customers in our area pay $10.00 shipping and others by specifying the postal codes pay $15.00. Hopefully i don't have to enter all the postal codes in my area and hoping that there is a default setting.

Thanks!!!
You would (unfortunately) have to enter all the postal codes that are 'local' into the Zip Code List for one ZipShip Zone and enter **00000 **as the Zip Code list for the other (out of range). Set the Calculation Method to *Items *and then enter the first Zones' Shipping Table as 9999:10 and the second one as 9999:15.

That will identify a $10.00 flat-rate shipping for the 'local' postal codes and $15.00 flat-rate shipping for further ones.

8 Dec 2020, 6:33 PM
#53
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Hi lat9,

Thanks for the replies. The problem I am having is that the format of my Canadian postal codes have a space between then(L4H 5A1 for example). Where in your wonderful code can I put the code to replace/remove the spaces, specifics will be appreciated.

Thanks in Advance!!!

8 Dec 2020, 6:57 PM
#54
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Never mind,

I figured it out I changed

$this->dest_zipcode = substr(strtoupper($order->delivery['postcode']), 0, (int)ENTRY_POSTCODE_MIN_LENGTH);

to

$this->dest_zipcode = substr(strtoupper(str_replace(' ', '',$order->delivery['postcode'])), 0, (int)ENTRY_POSTCODE_MIN_LENGTH);

which is working.

Great mod, don't know why I didn't find it sooner.

Thanks lat9!!!

8 Dec 2020, 7:43 PM
#55
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

allmart:

Hi lat9,

Thanks for the replies. The problem I am having is that the format of my Canadian postal codes have a space between then(L4H 5A1 for example). Where in your wonderful code can I put the code to replace/remove the spaces, specifics will be appreciated.

Thanks in Advance!!!
That shouldn't be an issue, so long as the minimum postcode length is set to 7, although some customers will enter that without the space.

Starting at line 63 of /includes/modules/shipping/zipship.php

                // -----
                // Gather the destination's zipcode, uppercasing and then truncating to the store's minimum zipcode length.
                //
                // NOTE:  I'm counting on the address-book generation logic for the store to have properly ensured that the
                // postcode entered is at least the minimum-length configured!
                //
                $this->dest_zone = false;
                $this->default_zone = false;
                $this->dest_zipcode = substr(strtoupper($order->delivery['postcode']), 0, (int)ENTRY_POSTCODE_MIN_LENGTH);
                for ($i = 1; $i <= $this->num_zones; $i++) {
                    $current_table = "MODULE_SHIPPING_ZIPSHIP_CODES_$i";
                    if (defined($current_table)) {
                        $zipcode_table = constant($current_table);
                        if ($zipcode_table === '00000') {
                            $this->default_zone = $i;
                        } else {
                            $zipcode_zones = explode(',', strtoupper($zipcode_table));
                            if (in_array($this->dest_zipcode, $zipcode_zones)) {
                                $this->dest_zone = $i;
                            }
                        }
                    }
                }

... make the highlighted changes:

                // -----
                // Gather the destination's zipcode, uppercasing and then truncating to the store's minimum zipcode length.
                //
                // NOTE:  I'm counting on the address-book generation logic for the store to have properly ensured that the
                // postcode entered is at least the minimum-length configured!
                //
                $this->dest_zone = false;
                $this->default_zone = false;
                $this->dest_zipcode = substr(strtoupper([B]str_replace(' ', '', [/B]$order->delivery['postcode'][B])[/B]), 0, (int)ENTRY_POSTCODE_MIN_LENGTH);
                for ($i = 1; $i <= $this->num_zones; $i++) {
                    $current_table = "MODULE_SHIPPING_ZIPSHIP_CODES_$i";
                    if (defined($current_table)) {
                        $zipcode_table = constant($current_table);
                        if ($zipcode_table === '00000') {
                            $this->default_zone = $i;
                        } else {
                            $zipcode_zones = explode(',', strtoupper([B]str_replace(' ', '', [/B]$zipcode_table[B])[/B]));
                            if (in_array($this->dest_zipcode, $zipcode_zones)) {
                                $this->dest_zone = $i;
                            }
                        }
                    }
                }
8 Dec 2020, 8:05 PM
#56
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Much better, Thanks!

Don't suppose there is a way to use wildcards in the postal code list. With most of my postal codes I only need the first 3 characters. There are a lot of variations.

9 Dec 2020, 12:38 PM
#57
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,089
Plugin Contributions:
56

Re: ZipShip - Support Thread

allmart:

Much better, Thanks!

Don't suppose there is a way to use wildcards in the postal code list. With most of my postal codes I only need the first 3 characters. There are a lot of variations.
In that section posted above, instead of using in_array to find matches, you could use a *foreach *loop to check for a match on the start.

9 Dec 2020, 1:13 PM
#58
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Thanks lat9 but that's over my head, your guidance is appreciated

9 Dec 2020, 3:49 PM
#59
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: ZipShip - Support Thread

Given that you said you only care about first 3 characters, you could maybe even use this additional change which only matches on the customer's first 3 supplied postal code characters:

                       } else {
                            $zipcode_zones = explode(',', strtoupper(str_replace(' ', '', $zipcode_table)));
                            if (in_array(substr($this->dest_zipcode, 0, 3), $zipcode_zones)) {
                                $this->dest_zone = $i;
                            }
                        }

... and then only define 3-char patterns in the module's list of supported postal codes.

9 Dec 2020, 5:39 PM
#60
allmart avatar

allmart

Zen Follower

Join Date:
Feb 2016
Location:
Canada
Posts:
192
Plugin Contributions:
0

Re: ZipShip - Support Thread

Thanks DrByte,

This is the dilemma I'm facing. There are 124,000 area codes in the area we deliver. I recently discovered that if I only went with the first 3 characters of the postal codes I will lose the ability to charge extra for customers that are further away which are located by the last 3 characters of the postal codes (6 alpha/numeric characters in Canada). We are located in in Toronto, all the postal codes are prefixed with "M" and we deliver to all of them. The surrounding immediate surrounding are prefix with "L" and some are in our near vicinity, some we don't deliver to at all (too far) and some I want to if I can charge extra. This is why I was hoping to have the ability to use wild cards. M***** would cover all my postal codes in Toronto and say L4**** would cover all postal codes that have that prefix ... and so on.

One problem I anticipate is that there are postal codes with the same prefix that I don't want to deliver to at all. For example if I put L7E in my postal codes for Zone1 but I don't want to deliver to postal code L7E1H7, will it not give me the rate for Zone1 instead of telling the customer that we don't deliver to their area.

Unfortunately there is a limit of how many postal codes can be entered approximately 9,600. Is there a way to increase the limit so I can use zipship the hardway which I am more than happy with.

Don't know if there is an easy solution to my problem and would appreciate any suggestions.