Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Shipping mods based on flat rate

    Someone had written a shipping mod based on the flat rate module for Australia Post rates. After making template changes to the site, the customer reported that the shipping was no longer working correctly. There's a choice between post and express post and no matter what you chose on checkout shipping, the first of the 2 choices showed up on the payment page.

    Looking at the mod, I thought that there was no way it ever worked before due to way the array or lack of array was written. I opted to write another module separating out the 2 choices. The flat module has the international shipping, domestic flat rate and book rate. The express module has only the express rate.

    Went back and checked out and the same - but different - thing is still happening. Only the flat rate gets put in to the payment page where as before only the first rate got put in.

    Any other module besides these two that is chosen works. I've looked at the two modules and checked the database for extra shipping configurations that shouldn't be there. But I can't see why this would be happening.

    I've written new flat rate modules before so I'm not clueless but I'm definitely not seeing the problem.

    The only difficulty I'm looking at is the zone. The flat domestic has an if statement for if international as follows and I'm wondering if this has anything to do with the problem. There's a dated comment where someone might have made a change last December that created this - maybe not.

    PHP Code:
    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE 0) ) {
            
    $check_flag false;
            
    $check $db->Execute("select zone_id from " TABLE_ZONES_TO_GEO_ZONES " where geo_zone_id = '" MODULE_SHIPPING_FLAT_ZONE "' and zone_country_id = '" $order->delivery['country']['id'] . "' order by zone_id");
            while (!
    $check->EOF) {
              if (
    $check->fields['zone_id'] < 1) {
                
    $check_flag true;
                break;
              } elseif (
    $check->fields['zone_id'] == $order->delivery['zone_id']) {
                
    $check_flag true;
                break;
              }
              
    $check->MoveNext();
            }

            if (
    $check_flag == false) {    //this order is international shipping
                // $this->enabled = false;
                
                
    $this->is_international true;
                
    $this->enabled false;    //12/18/2009, 17:52:43  by Hao to disable flat shipping when international is on
            

    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Shipping mods based on flat rate

    You may not need to re-write anything...

    If it was a TEMPLATE change, then you just need to go into the OLD template folders and make copies of modules that were used under that template, and put them (the relevant files) into the new template folders.

    With SHIPPING, there are commonly TWO php files (usually with the same NAME). One file will be in the MODULES section. The other will be a LANGUAGE file in the LANGUAGE section.

    (By "section" I mean folder/directory tree)
    20 years a Zencart User

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Shipping mods based on flat rate

    I doubt very seriously that the template changes could have done this. I'm not a newbie at this to put it mildly. My belief at this point is that this has not worked possibly ever or at least since the change was made in December. Too few people choose the express option to have it come up very often.

    We're using the same modules / overrides as before. The only changes would be in the templates/domain/templates folder. My changes were made after someone tried to change the theme with very poor success in January. I don't know what the original theme was that did work. I did check the files to make sure that the form input fields are being named properly, etc.
    The full-time Zen Cart Guru. WizTech4ZC.com

  4. #4
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Shipping mods based on flat rate

    I see the issue... The buffoon called Hao has introduced a conditional that is better governed by standard settings in the database zone definitions functionality. (Typical error made by someone with adequate PHP knowledge, but no understanding of how ZC works!)

    You may be better of starting from scratch and configuring the modules according to standard protocol.

    I would start by looking at the zones and zone definitions in the database. Make sure these are relevant to the intended shipping methods, then REMOVE old shipping modules and install new ones. (This will involve overwriting/disabling the duffy "Hao" files).
    20 years a Zencart User

  5. #5
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Shipping mods based on flat rate

    Thanks so much for the confirmation. Not hard to separate out the international shipping from all that!
    The full-time Zen Cart Guru. WizTech4ZC.com

  6. #6
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,263
    Plugin Contributions
    3

    Default Re: Shipping mods based on flat rate

    I'm puzzled... how can the FLAT RATE module be configured for AusPost - where there are a considerable array of variables?

    Have you looked at Rod_G's ozpost module?
    http://www.zen-cart.com/index.php?ma...oducts_id=1286

    I would seriously start the "fix" from scratch...

    Only worry is... what else did "Hao" mess up when he/she tried to adjust that conditional?
    20 years a Zencart User

 

 

Similar Threads

  1. Flat rate shipping based on location
    By ztotheetothen in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 10 Feb 2011, 08:21 PM
  2. flat rate shipping based on weight?
    By cpoet in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 5 Aug 2010, 07:34 AM
  3. I need 2 flat rate shipping mods for two couriers
    By Baa in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 16 Oct 2009, 06:05 PM
  4. Flat rate shipping, based on delivery method
    By goldndelicious in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 4 Oct 2009, 09:26 PM
  5. Flat Rate Shipping based on Product
    By Tihumatech in forum Addon Shipping Modules
    Replies: 1
    Last Post: 12 Dec 2008, 08:40 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