farjam
farjam

Reputation: 2289

OpenCart: Displaying the recently-viewed items for the current viewer

On my OpenCart website, I'm trying to display the recently viewed items by the current user. The current user can be either logged in or logged out.

I don't see any table in my database that would keep track of such data. Does anybody know what would be the best option to go about this? Should I be creating cookies to do this?

Upvotes: 1

Views: 632

Answers (1)

Ramesh
Ramesh

Reputation: 1204

If I am not wrong you are saying current user (may not be logged in) and his recent viewed product, Here you dont have user id so you can set Cookie for this instead of using database.

If you want to keep track of recent viewed product for particular user only, you can store it in database like opencart does for wishlist/add to cart list etc so that when ever user logs in the last viewed products appears.

//library/customer login() and logout()

Upvotes: 1

Related Questions