Naming conventions
Plugin classes
A main class declared in the plugin's API (the main.js file of the plugin) must be named followingly:
- starts with the prefix Plugin
- the path for the plugin without slashes follows
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:
- starts with the prefix Theme
- the path for the theme without slashes follows
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.