Post by st_man » Tue May 04, 2021 12:14 am

Is there a way to look at what a person has saved in their cart even if they are not registered but are online? Where is that info saved? PHPMYAdmin database or some kind of session variable on their machine?

New member

Posts

Joined
Sun Jan 26, 2014 6:13 am

Post by ADD Creative » Tue May 04, 2021 1:57 am

What version?

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by st_man » Tue May 04, 2021 6:31 am

1.4.6.5

New member

Posts

Joined
Sun Jan 26, 2014 6:13 am

Post by straightlight » Tue May 04, 2021 9:45 am

Previous generation.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Tue May 04, 2021 4:34 pm

It's stored in the session data for guests. For registered customers who are logged in, it's also stored in the cart column of the oc_customer table in the database.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by st_man » Thu May 06, 2021 8:36 am

How can I access the session data. Specifically, I wanted to see the cart contents of a person shopping on my site. They are not registered.
Can you explain as I am not a Opencart expert.
Thanks

New member

Posts

Joined
Sun Jan 26, 2014 6:13 am

Post by ADD Creative » Thu May 06, 2021 11:32 pm

You would need to look in the session_save_path. You would probably have to deserialize the session data and then find the correct session.

www.add-creative.co.uk


Active Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Fri May 07, 2021 9:01 pm

st_man wrote:
Thu May 06, 2021 8:36 am
How can I access the session data. Specifically, I wanted to see the cart contents of a person shopping on my site. They are not registered.
Can you explain as I am not a Opencart expert.
Thanks
Since the session data is converted into an array from the system/library/cart/cart.php file - > getProducts() method, from a controller, you could call the:

Code: Select all

$cart_products = $this->cart->getProducts();
Then, fetch the array and add the required conditions into the loop.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 16 guests