View Single Post
  #2  
Old 10-28-2015, 10:21 AM
Qetzal's Avatar
Qetzal Qetzal is offline
Ecwid Team
 
Join Date: Sep 2009
Posts: 10,847
Default

Quote:
Originally Posted by ukcfacademy View Post
Hi all,

I am attempting to postpone the load of ECWID until I activate the div in which it is stored, and generally gain more control over when the xSingleProduct() widget is loaded.

Currently, if I call the function xSingleProudct() in line in a script tag, as the documentation states, it all works fine.

However if I call the function after the page finished loading (e.g. on click, or on $(document).ready(...) ). then it replaces the entire contents of the page with:

<body><div id="SingleProduct-1"></div></body>

jsfiddle: https://jsfiddle.net/Lgxn8v3c/1/

Is there a way to do something like this or is there some kind of obvious scope issue I am missing here?

Many thanks!
Hi,

Try to replace our Single product widgets with custom buttons that use our JavaScript API to add items to a bag: https://help.ecwid.com/customer/en/p...CartaddProduct
__________________
Eugene K.
Ecwid Team

@ecwid | Facebook | Ecwid Knowledge Base