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 November 13, 2018 18:19)

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"]+ ")" %} and this repeater will be visible based on {%!String.IsNullOrEmpty(Cookies["RecentlyViewed"])%}.

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.