Javascript core API's Javascript core API is bundled into a single main.js file.

Download the main.js file

You should be aware at least of the Surikata.renderPluginJSON() method. This method is used to send a request to a plugin. The response from such call is in a JSON format which you can process further in your Javascript code.

An example for adding a product to the shopping cart is quite simple:

    'idProduct': idProduct,
    'qty': qty,
    'cartAction': 'addToCart',
  function (data) {
    // your own processing

The example below sends a request to WAI/Customer/Cart plugin with idProduct and qty values. The returned data can be further processed, e.g. you can show a popup window with the confirmation of successfull operation.

Javascript API of plugins

To make the use of Javascript Core API more simple, some default plugins expose their own API which contains wrapper methods e.g. for working with shopping cart.

Read more in the chapter Javascript API of Plugins.

E-commerce development framework