Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Posts
    62
    Plugin Contributions
    1

    Default Developing for Zen Cart - persistent data and autoloaders

    I am working on a mod for zen cart and I have two questions:

    1. What is the best way to maintain custom data between pages, such as flags that cause checkout pages to behave in certain way? I think I need a flag that shows whether the user has chosen certain products in the checkout process. I was thinking about just appending those flags to the url and grabbing them off the GET in the next page. Do I need to add them to the $parameters variable? It would be nice if there were a few $userflag variables with accessor / modifier functions in the shopping_cart class that could be used to store this information in user sessions.

    2. It is looking like I am going to have a product that will need to be an exclusive product to the cart. So I was thinking that there will need to be an observer used to monitor this. This observer will remove the exclusive product from the cart if they add another product and set a flag to output a message to the customer notifying of this. When adding it to the autoloaders, I am have a tough time determining which breakpoint in the array to place it at. Is breakpoint 90 the correct spot?



    Any help with this would be much appreciated.

  2. #2
    Join Date
    Jun 2007
    Location
    San Diego, CA
    Posts
    62
    Plugin Contributions
    1

    Default Re: Developing for Zen Cart - persistent data and autoloaders

    Okay - replying to my own post.

    1. I realized that I could create a session variable using the following code:

    Code:
       session_register ("user_flag"); // Create a session variable called  user_flag 
       $_SESSION['user_flag'] = 'true';

    2. According to the wiki, when adding a listener to the shopping cart position 90 works

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Developing for Zen Cart - persistent data and autoloaders

    you can just do

    PHP Code:
    $_SESSION['user_flag'] = 'true'
    no need for the session_register part
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. Replies: 1
    Last Post: 23 Mar 2010, 05:23 AM
  2. Developing a seller's marketplace with Zen Cart?
    By Squid Vicious in forum General Questions
    Replies: 4
    Last Post: 9 Mar 2010, 07:23 PM
  3. Viewing and Developing for IE6
    By limelites in forum General Questions
    Replies: 5
    Last Post: 10 Jul 2009, 10:04 AM
  4. Moved Zen Cart from one computer to another and lost data
    By acanthuscarver in forum General Questions
    Replies: 2
    Last Post: 4 Oct 2007, 12:39 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