Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Re: Getting/Displaying the Customer's State

    I think my problem lies here:
    PHP Code:
    if (isset($_SESSION['customer_country_id']) && isset($_SESSION['customer_zone_id'])) { 
    Anything I add to that code inside the brackets does not display regardless whether I'm logged in or not. Would that be happening because I'm on a localhost environment?
    PHP Code:
    $state_code '';
    $state_name '';
    if (isset(
    $_SESSION['customer_country_id']) && isset($_SESSION['customer_zone_id'])) {
      
    $state_info $db->Execute("SELECT zone_code, zone_name FROM " TABLE_ZONES " WHERE zone_country_id = " $_SESSION['customer_country_id'] . " AND zone_id = " $_SESSION['customer_zone_id'] . " LIMIT 1");
      if (!
    $state_info->EOF) {
        
    $state_code $state_info->fields['zone_code'];  // 2-character code
        
    $state_name $state_info->fields['zone_name']; // Full name
      
    }
    $any_variable_here 'does not display';


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

    Default Re: Getting/Displaying the Customer's State

    Nope, localhost environment shouldn't affect the display; I'm running a version of XAMPP to do my local testing. Where are you displaying the value; it's not being displayed in the header, just created, so you'll need to add something to your customized tpl_checkout_success_default.php to
    Code:
    echo "State code: ($state_code), state name: ($state_name)";

  3. #13
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Re: Getting/Displaying the Customer's State

    I'm testing on a clean installation.

    I created a header_php_test.php with the following code:
    PHP Code:
    <?php
            $_SESSION
    ['customer_country_id'] = $check_country->fields['entry_country_id'];
            
    $_SESSION['customer_zone_id'] = $check_country->fields['entry_zone_id'];

            
    $state_code '';
            
    $state_name '';
            if (isset(
    $_SESSION['customer_country_id']) && isset($_SESSION['customer_zone_id'])) {
              
    $state_info $db->Execute("SELECT zone_code, zone_name FROM " TABLE_ZONES " WHERE zone_country_id = " $_SESSION['customer_country_id'] . " AND zone_id = " $_SESSION['customer_zone_id'] . " LIMIT 1");
              if (!
    $state_info->EOF) {
                
    $state_code $state_info->fields['zone_code'];  // 2-character code
                
    $state_name $state_info->fields['zone_name']; // Full name
              
    }
            }

            
    $test 'this is a test dialog';

    ?>
    On the tpl_checkout_success_default.php I added the following above the last div tag:

    PHP Code:
    <?php echo $test?>
    <br />
    <?php echo $state_code?>
    <br />
    <?php echo $state_name?>
    Still all I can see at the bottom of index.php?main_page=checkout_success is "this is a test dialog", but still no customer state info is displayed.

  4. #14
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,633
    Plugin Contributions
    88

    Default Re: Getting/Displaying the Customer's State

    Why are you setting the session values for the country and zone IDs (they should already be set)? Try removing the first two lines in your header_php_test.php.

  5. #15
    Join Date
    Jun 2008
    Location
    Osprey, Florida
    Posts
    151
    Plugin Contributions
    14

    Default Re: Getting/Displaying the Customer's State

    You are right!!!

    You are absolutely awesome. Thank you so much!!!

    Yes, I'm excited...

  6. #16
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,633
    Plugin Contributions
    88

    Default Re: Getting/Displaying the Customer's State

    Woo-hoo! Happy to help ...

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v151 Getting/Displaying the Customer's Country
    By ultimate_zc in forum General Questions
    Replies: 7
    Last Post: 9 Feb 2014, 09:41 PM
  2. Can I change the State to just the State Code?
    By rbobzin in forum General Questions
    Replies: 0
    Last Post: 10 Jul 2008, 10:58 PM
  3. I want to add a button to my website so that the customer can state his amount ......
    By lrfowler in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 14 May 2008, 06:28 AM
  4. how do I rename the word "state" - asin the state dropdown on the checkout page?
    By SoftDux in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 4 Mar 2008, 07:19 PM
  5. Customer Reviews - displaying the name
    By ginginca in forum General Questions
    Replies: 1
    Last Post: 18 Feb 2007, 11:52 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