Recently viewed products

Lovely Sidhu asked on November 13, 2018 17:47

How to implement recently viewed products listing? What should I better use?

Recent Answers


Peter Mogilnitski answered on November 13, 2018 18:10 (last edited on December 10, 2019 02:31)

What first comes to my mind is to save skuid into cookies when a user visits a product page, and then use regular repeater to show products based on ids that you get from cookies. Your repeater WHERE will look like: {% String.IsNullOrEmpty(Cookies["RecentlyViewed"],""," SKUID IN (" + Cookies["RecentlyViewed"]+ ")" |(identity)GlobalAdministrator%}.

P.S. You need to create a web part that updates the cookie and add it to your product template.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.