Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default If/Then for Message Based on Shipping Zone

    I'd like to have a message appear during checkout (on page, not a pop up) based on the zone of the shipping address.

    I need assistance creating the proper IF/Then statement.

    I can sort out the echo portion, just not sure how to properly check for the zone.

    Any help would be much appreciated.

    Thanks.

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

    Default Re: If/Then for Message Based on Shipping Zone

    On any of the checkout pages:
    Code:
    $selected_zone = false;
    if (isset ($order->delivery) && is_array ($order->delivery)) {
        $selected_zone = $order->delivery['zone_id'];
    }
    That will result in a selected zone that's either a number (which could be 0 if there's no zone associated with the customer's country) or boolean false.

    If the order contains only virtual products (e.g. downloads), then the shipping/delivery address section is not an array; that's where that check comes from.

  3. #3
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: If/Then for Message Based on Shipping Zone

    How can I alter this so it references geo_zone_id instead (wants to filter based on master zone)?

  4. #4
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: If/Then for Message Based on Shipping Zone

    Just realized I need one additional piece that I'm having trouble with.

    I need to filter based on order sub-total as well.

  5. #5
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,697
    Plugin Contributions
    123

    Default Re: If/Then for Message Based on Shipping Zone

    Code:
    if ($order->info['subtotal'] > some-threshold) {
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  6. #6
    Join Date
    Jun 2007
    Posts
    474
    Plugin Contributions
    2

    Default Re: If/Then for Message Based on Shipping Zone

    That worked. Thanks.

 

 

Similar Threads

  1. v139h Zone shipping - Can I disable purchase of certain items based on a shipping zone?
    By gsh68 in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 7 Aug 2017, 07:05 PM
  2. Shipping Based on Zone Name
    By FoodDudes in forum General Questions
    Replies: 3
    Last Post: 17 Feb 2011, 05:34 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