Post by budgetneon » Fri Feb 19, 2016 7:37 pm

In opencart 2.0.x, there was a session variable called 'cart' that existed if the customer in that session had added something to the cart.

In the 2.1.x release, it appears the cart handling code was significantly changed, and the 'cart' session variable was removed.

This is bad news for the page cache module we wrote, as there doesn't appear to be any lightweight way to tell if the current session has an empty cart or not. We depended on that, as a pagecache (to be fast / lightweight) shouldn't be doing things like database queries.

Basically, the page cache would only cache (and serve cached pages) over a specific set of conditions, like 'user is not logged in', 'cart is empty', etc. And, prior to 2.1.x, you could tell that without loading the opencart engine, and without doing anything heavyweight, like a database query.

I'm thinking over how to deal with this situation, but so far the only choices seem to be:
  • querying the database to see if the cart if empty, from the pagecache code
  • ==or==
  • patching the cart code to create/delete a session variable or cookie when the cart is empty or not
Posting here to see if I'm missing anything obvious...perhaps there's some other existing way to tell if the cart is empty or not?

New member

Posts

Joined
Sat Sep 20, 2014 11:32 pm

Who is online

Users browsing this forum: No registered users and 6 guests