Jump to content

Help storing a flag in session or cookie.


Guest ElBonzi

Recommended Posts

Guest ElBonzi

I'm using a popup window on my page that opens when someone tries to click "view cart". The popup calls a php script that checks if theyre in a deliverable radius (shows them a message otherwise) and I then want to store a flag like inDeliveryZone that persists in cubecarts session or in a cookie.

So the question is - how would i store a variable in the session or in a cookie so I can reference it in shoppingCart.inc.php?

Link to comment
Share on other sites

I'm using a popup window on my page that opens when someone tries to click "view cart". The popup calls a php script that checks if theyre in a deliverable radius (shows them a message otherwise) and I then want to store a flag like inDeliveryZone that persists in cubecarts session or in a cookie.

So the question is - how would i store a variable in the session or in a cookie so I can reference it in shoppingCart.inc.php?

Cubecart uses the database for sessions, so you could add an extra field in the Sessions table.

If you then read the /includes/global/switch.inc.php, you'll see how CubeCart uses the sessions table to retain the currency/langage settings.

The above, does not require cookies, and so may be cleaner.

With this set, you can then attempt to read it back in the shoppingCart.inc.php code, and manipulate the template output to suit.

If you actually need help implementing this, then hop over to CubeCartForums.org for help.

Jason

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...