Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Location
    Sydney, Australia
    Posts
    66
    Plugin Contributions
    0

    Default Country specific code

    Hi,

    I would like to add some code that would cause some text to appear after the product description. The code needs to check if a user is logged in and then if logged in, check which country their billing address is in. Depending upon their country, different HTML would be displayed.

    The code would look like this:

    if (logged in) {
    if (billing_country == australia) {
    echo blah1;
    } elsif (billing_country == USA) {
    echo blah2;
    }
    }

    etc.
    What is the best way to do this? Its just on the product info page template.

    Thanks in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Country specific code

    Some technical information which may help you with your custom coding needs:

    When the customer is logged in you will have
    $_SESSION['customer_id'] > 0

    Country is then set to:
    $_SESSION['customer_country_id']

    Zone is then set to:
    $_SESSION['customer_zone_id']

    You can find available country id numbers in your database's "countries" table.
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Apr 2006
    Location
    Sydney, Australia
    Posts
    66
    Plugin Contributions
    0

    Default Re: Country specific code

    Thanks Ajeh! As always you make it look easy.

 

 

Similar Threads

  1. v151 Count clients in a specific country?
    By d0ugparker in forum General Questions
    Replies: 2
    Last Post: 14 Jun 2016, 07:56 AM
  2. country specific views
    By ajaipandey in forum Addon Payment Modules
    Replies: 0
    Last Post: 9 Oct 2010, 10:38 AM
  3. Country-Specific Prices
    By toretore in forum General Questions
    Replies: 0
    Last Post: 1 Dec 2009, 05:13 PM
  4. Country specific
    By losvre in forum General Questions
    Replies: 0
    Last Post: 21 Nov 2009, 01:35 AM

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