Page 6 of 10 FirstFirst ... 45678 ... LastLast
Results 51 to 60 of 95
  1. #51
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

    Default 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!!!

  2. #52
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: ZipShip - Support Thread

    Quote Originally Posted by allmart View Post
    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.

  3. #53
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

    Default 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!!!

  4. #54
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

    Default 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!!!

  5. #55
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: ZipShip - Support Thread

    Quote Originally Posted by allmart View Post
    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
    Code:
                    // -----
                    // 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:
    Code:
                    // -----
                    // 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(str_replace(' ', '', $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(str_replace(' ', '', $zipcode_table)));
                                if (in_array($this->dest_zipcode, $zipcode_zones)) {
                                    $this->dest_zone = $i;
                                }
                            }
                        }
                    }

  6. #56
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

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

  7. #57
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: ZipShip - Support Thread

    Quote Originally Posted by allmart View Post
    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.

  8. #58
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

    Default Re: ZipShip - Support Thread

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

  9. #59
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default 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:

    Code:
                           } 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.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #60
    Join Date
    Feb 2016
    Location
    Canada
    Posts
    143
    Plugin Contributions
    0

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

 

 
Page 6 of 10 FirstFirst ... 45678 ... LastLast

Similar Threads

  1. Hebrew Support - latest release [Support Thread]
    By eranariel in forum Addon Language Packs
    Replies: 19
    Last Post: 23 Jan 2023, 08:04 AM
  2. SysCheck [support thread]
    By swguy in forum All Other Contributions/Addons
    Replies: 36
    Last Post: 24 Oct 2020, 05:28 AM
  3. v151 Ship2Pay Support thread
    By Design75 in forum All Other Contributions/Addons
    Replies: 9
    Last Post: 5 Nov 2019, 01:14 PM
  4. goMobile Support Thread
    By steveyork136 in forum Addon Templates
    Replies: 29
    Last Post: 26 Aug 2015, 11:56 AM
  5. ZJ Silver Support Thread
    By anthonyd in forum Addon Templates
    Replies: 220
    Last Post: 5 Nov 2010, 03:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR