Naming conventions

Plugin classes

A main class declared in the plugin's API (the main.js file of the plugin) must be named followingly:

Example for class in WAI/Customer/Cart plugin:

function PluginWAICustomerCart() { } // declaration of the class

PluginWAICustomerCart.prototype.addProduct = function (idProduct, qty, success) {
  //
}

Theme classes

A main class declared in the theme's API (the name of the javascript file is arbitrary) must be named followingly:

Example for the Basic theme's class manipulating the shopping cart:

function ThemeBasicCart() { PluginWAICustomerCart.call(this); }
ThemeBasicCart.prototype = Object.create(PluginWAICustomerCart.prototype);

ThemeBasicCart.prototype.updateHeaderOverview = function (html) {
  //
}

Note: This class inherits from the PluginWAICustomerCart class as it will be used for manipulating the shopping cart.

Surikata
E-commerce development framework