Results 1 to 6 of 6

Threaded View

  1. #2
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    6,167
    Plugin Contributions
    7

    Default Re: Sharing PHP variables ($_SESSION issue)

    Quote Originally Posted by flyvholm View Post
    I'm writing a PHP script to communicate with Amazon for their fulfillment service. The script needs to access information that Zen Cart stores in the $order variable.

    Q1) How does Zen Cart preserve and make a variable like $order accessible across pages?
    Either via the GLOBALS (classes) or the $_SESSION variables.

    Quote Originally Posted by flyvholm View Post
    Q2) Any idea why session_start() creates a new session instead of resuming?
    Because session_start() literally starts a new session. Clearly this isn't what you want since ZenCart already has a session started.

    At the start of you module functions add

    global $order ;

    Retrieve values using code like:

    $myPostcode = $order->delivery['postcode']

    Cheers
    RodG
    Last edited by RodG; 15 Oct 2014 at 06:10 PM.

 

 

Similar Threads

  1. setting $_SESSION variables in an Observer Class
    By tcarden in forum Contribution-Writing Guidelines
    Replies: 1
    Last Post: 13 Feb 2013, 06:37 AM
  2. Passing variables without $_SESSION
    By fred_tededmondsson in forum General Questions
    Replies: 1
    Last Post: 31 Oct 2011, 07:25 PM
  3. Replies: 1
    Last Post: 21 Apr 2010, 06:37 PM
  4. Replies: 3
    Last Post: 10 Apr 2009, 10:37 PM
  5. where are $_SESSION variables set in order process
    By apathy in forum General Questions
    Replies: 0
    Last Post: 30 May 2008, 01:58 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