Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Accessing delivery state name for customization

    Hi:

    I am adding a test for delivery state in zones.php. I am using the following statement $state = $order->delivery['state']; after setting global $db; Is it correct? Is there a place where developers can look for correct syntax and access of zen cart variables?

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

    Default Re: Accessing delivery state name for customization

    It depends on what you want to get and where in the code you are when you want to get it ...

    $state = $order->delivery['state'];

    says you want to access the order class and get the delivery state, but that is not accessing the database where you need access to the $db ... you need access to the $order so the global would be on that:
    global $order;
    $state = $order->delivery['state'];

    and providing the $order exists where you are testing for this, then it would be available ...

    You can always add a var_dump of the array, such as:
    global $order;
    echo var_dump($order);

    to see the content to know if the data is available within the function you are trying to add this test ...
    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
    Mar 2009
    Location
    New York
    Posts
    157
    Plugin Contributions
    0

    Default Re: Accessing delivery state name for customization

    Thanks. I was using it in zones.php. I added global $db; after global $cart; Since it worked I can retest after removing global $db; Thanks again

 

 

Similar Threads

  1. v151 Should TaxCloud be passing State Code or State name to TaxCloud for verification?
    By RCwebdev in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 9 Dec 2013, 10:16 PM
  2. Can you block a specific CITY within a state from delivery?
    By Sellerz in forum Managing Customers and Orders
    Replies: 2
    Last Post: 7 Jan 2013, 04:39 PM
  3. Postcode, city, state customization
    By yokozuna in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Jan 2012, 05:17 AM
  4. Invoice does not display the delivery state
    By zzfozz in forum PayPal Website Payments Pro support
    Replies: 7
    Last Post: 21 Aug 2009, 05:36 PM
  5. Problem Accessing Admin After Changing Folder Name
    By enchantedone in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 12 Jun 2006, 05:13 PM

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