Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2012
    Posts
    30
    Plugin Contributions
    0

    Default How to get the customer country value from checkout_shipping page?

    Hi,

    I'm looking to update the main_page=checkout_shipping page and display a message prior to the shipping methods list.

    My message will be dependent on the value of the country already populated on the checkout page.

    Does one know how to get access to the country value? I can't determine from the form submitted on the previous page where it is stored.

    Regards.

  2. #2
    Join Date
    Dec 2012
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to get the customer country value from checkout_shipping page?

    More than 80 views? No one has an idea?

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

    Default Re: How to get the customer country value from checkout_shipping page?

    Not understanding "why" you're asking this particular question.

    What's the bigger picture here?

    And in what ways does your site differ from original Zen Cart code?
    .

    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.

  4. #4
    Join Date
    Dec 2012
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to get the customer country value from checkout_shipping page?

    The end goal is to drive what values I show in the shipping options list.

    On the shipping estimator file I was able to get the value of the currently selected country by reading it from the session. The page I modified in this case was: tpl_modules_shipping_estimator.php

    $countryid = $_SESSION['cart_country_id'];

    I would like to perform the same type of change on the Shipping selection page in the check out process (tpl_checkout_shipping_default.php). I tried to get the cart_country_id from the session and it didn't work. I'm looking if anyone knows where the data is stored or if its under a different attribute in the session.

    Thanks!

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

    Default Re: How to get the customer country value from checkout_shipping page?

    You still didn't answer my question. But maybe you want it all to be secret. Fine.

    I think you're going at it from the wrong angle.

    Why aren't you driving what's shown by having each shipping module make the necessary decisions for you? That's how they're designed to work.
    .

    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.

  6. #6
    Join Date
    Dec 2012
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to get the customer country value from checkout_shipping page?

    Hi,

    I think I'm not understanding.

    First I'm new to zencart so some pieces of it are a mystery to me as to how they work.

    Regarding the mod I'm trying to make, I thought I explained it, but let me try again.

    In short, I have the USPS shipping mod installed. When a user is from a country other than the US, I want to hide the all shipping options and just display USPS (1 x 2.00lbs) (Priority Mail International). Otherwise, I will display the rest of the shipping methods offered.

    On the shipping estimator, I controlled this by looking at the country id ($countryid == 223).

    In the tpl_checkout_shipping_default.php file it doesn't seem to be in the same session variable, so I was trying to find it and posed the question.

    If there is another way to do this from just a configuration, I am all for that!! :) I don't want to custom code something unless I really have to.

    Regards.

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

    Default Re: How to get the customer country value from checkout_shipping page?

    Quote Originally Posted by kapsolas View Post
    In short, I have the USPS shipping mod installed. When a user is from a country other than the US, I want to hide the all shipping options and just display USPS (1 x 2.00lbs) (Priority Mail International). Otherwise, I will display the rest of the shipping methods offered.
    THAT is the important information you hadn't shared previously.

    Why don't you just go into your USPS module settings (Admin->Modules->Shipping->USPS->Edit) and uncheck the boxes of services you don't wish to offer for "international" destinations?
    .

    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.

  8. #8
    Join Date
    Dec 2012
    Posts
    30
    Plugin Contributions
    0

    Default Re: How to get the customer country value from checkout_shipping page?

    Thanks DrByte! I'll try this and see how it works with my other flow.

    We have some rules implemented for which shipping module to make available based on attributes set on the products.
    I'll see if this fits our solution.

    Thanks for the tip!

 

 

Similar Threads

  1. <a href statement how do I get a url value from the database?
    By suedouglas in forum General Questions
    Replies: 11
    Last Post: 21 May 2015, 11:59 AM
  2. v151 Do you know how to remove customer's country from Invoice?
    By gsmsalers in forum Managing Customers and Orders
    Replies: 2
    Last Post: 8 Oct 2013, 02:53 AM
  3. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 3
    Last Post: 8 Feb 2009, 03:20 AM
  4. how to get the value of order total ?
    By greenlight in forum General Questions
    Replies: 1
    Last Post: 7 Feb 2009, 09:23 AM
  5. How can I get subtotal value at the checkout success page?
    By dmcontact in forum General Questions
    Replies: 1
    Last Post: 12 Sep 2008, 05:56 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