[Skip to main content](#vessel-content)

#   Load Recently Viewed Products with JavaScript and AJAX

##

- **[NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")**
- [![NigelPeck's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32534.jpg)](/forum/user/32534-nigelpeck "View NigelPeck's Profile") Topic Author
- [ Offline](/forum/user/32534-nigelpeck)

Less More

- Posts: 56
- Thank you received: 1
-
-
- [](https://www.sharphosting.uk/)
-

9 years 6 months ago [\#270212](#270212) by [NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")  *[Load Recently Viewed Products with JavaScript and AJAX](/forum/26-product-category-display/890381-load-recently-viewed-products-with-javascript-and-ajax#270212 "I am looking at how I can load recently viewed products using JavaScript and AJAX. This is so product pages can be served from a Varnish cache, and then have the recently viewed products, which is the...")* was created by *[NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")*

I am looking at how I can load recently viewed products using JavaScript and AJAX. This is so product pages can be served from a Varnish cache, and then have the recently viewed products, which is the only dynamic content on the page in my case (catalogue only mode), pulled in with AJAX on the client-side.

Is there anything existing that can do this, or go some way towards doing this? Just checking before I look at having something developed.

Thanks.

---

Professional website services including website management, Linux server admin and web hosting.
[ www.sharphosting.uk/](https://www.sharphosting.uk/)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTAzODEtbG9hZC1yZWNlbnRseS12aWV3ZWQtcHJvZHVjdHMtd2l0aC1qYXZhc2NyaXB0LWFuZC1hamF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

9 years 6 months ago [\#270231](#270231) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Load Recently Viewed Products with JavaScript and AJAX](/forum/26-product-category-display/890381-load-recently-viewed-products-with-javascript-and-ajax#270231 "I am looking at how I can load recently viewed products using JavaScript and AJAX. This is so product pages can be served from a Varnish cache, and then have the recently viewed products, which is the...")*

Hi,

The simplest way to get the recently viewed products from HikaShop is to enable the recently viewed products module (it's a module instance of HikaShop content module which is preinstalled with HikaShop to display that).
The issue with that in your case is that modules are supposed to be displayed on a template position and thus you have all the other modules and template around it.
Fortunately, Joomla has the tmpl=component parameter trick to be able to load a page with only the main content on it, without the modules and the template around.
Then, you just have to have that module displayed as main content. For example, with the load position content tag in a Joomla article, or with such extension: [ extensions.joomla.org/extension/m2c-module-to-component/](https://extensions.joomla.org/extension/m2c-module-to-component/)
That way, you can have a URL you can call to get the HTML of the recently viewed products module, and you can use that URL in an AJAX request in your javascript.
That's the simplest and doesn't need any coding.

The following user(s) said Thank You: [NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTAzODEtbG9hZC1yZWNlbnRseS12aWV3ZWQtcHJvZHVjdHMtd2l0aC1qYXZhc2NyaXB0LWFuZC1hamF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")**
- [![NigelPeck's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar32534.jpg)](/forum/user/32534-nigelpeck "View NigelPeck's Profile") Topic Author
- [ Offline](/forum/user/32534-nigelpeck)

Less More

- Posts: 56
- Thank you received: 1
-
-
- [](https://www.sharphosting.uk/)
-

9 years 6 months ago [\#270353](#270353) by [NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")  Replied by *[NigelPeck](/forum/user/32534-nigelpeck "View NigelPeck's Profile")* on topic *[Load Recently Viewed Products with JavaScript and AJAX](/forum/26-product-category-display/890381-load-recently-viewed-products-with-javascript-and-ajax#270353 "I am looking at how I can load recently viewed products using JavaScript and AJAX. This is so product pages can be served from a Varnish cache, and then have the recently viewed products, which is the...")*

This is great info Nicolas, thanks. Should do what I need perfectly, will work on getting it set up.

---

Professional website services including website management, Linux server admin and web hosting.
[ www.sharphosting.uk/](https://www.sharphosting.uk/)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTAzODEtbG9hZC1yZWNlbnRseS12aWV3ZWQtcHJvZHVjdHMtd2l0aC1qYXZhc2NyaXB0LWFuZC1hamF4P3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.064 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
