View Single Post
Old 11-04-2015, 04:56 PM
ukcfacademy's Avatar
ukcfacademy ukcfacademy is offline
Junior Member
Join Date: Oct 2015
Posts: 2

Hi there,

Thank you for your response. That is in fact already how I am adding the products to the cart, but for an unrelated reason - to be able to add multiple items using one button.

I am however trying to fetch and initialize the products, price and available options, rather than add an item to the cart. Ideally I would like to avoid hard coding all of the names and options, as these are likely to get changed in the admin panel.

The problem I am having is that loading multiple single products on a page has a fairly severe performance hit on page load time, and if at all possible, I would like to minimize this - ideally by only loading the products when a tab element is accessed.

What I am hoping to do is only call the xSingleProduct() if a user wants to access the widget (which is hidden on page load). I am happy for all the products on the page to be loaded, after that point.

I have attempted to do this through every method I could think of (both through onclick handlers, appending javascript, ) with the same result each time - the page getting blanked out.

It seems like a fairly sensible thing to be able to do (e.g. - it would make a lot of sense for a user to want to initialize the widget within a JQuery $(document).ready() block for instance), so I am not sure if I have just not tried something obvious or I have stumbled into a bug.

Many thanks!

PS: The website in question is, specifically the Book Now box, which is an element present on the vast majority of pages on the site.