Ematic.js module for Prestashop 1.6.x and below
Installation
Do the following steps to install the module:
- Download the module archive from this link.
- Login to your Back Office (admin panel).
- Go to ‘Modules and Services’.
- On the top-right corner press on ‘Add new module’ button.
- Upload your module as shown below:
- Install and configure the uploaded module:
Configuration
Do the following steps to configure the module:
- Go to ‘Modules and Services’ and find Ematics module.
- Enter your Ematic API Key and Save.
API Key
You should receive an API Key from Ematic Solutions, if you don’t have an API Key please contact your Customer Success Manager.
Ajax Cart Logging
By default Ematics module works with a standard cart system that refreshes the page after adding product to a cart. If your website is using Ajax cart system (no page-refresh) then you should add below code to your theme.
In your /web/themes/
ematics_blockcart_log(jsonData);
It should be inserted in the “add” method’s “success” callback function at the very top, for example:
add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist){
...
//send the ajax request to the server
$.ajax({
...
success: function(jsonData,textStatus,jqXHR)
{
//Ematics Module
ematics_blockcart_log(jsonData);
// add appliance to whishlist module
if (whishlist && !jsonData.errors)
...
It should be inserted in the “remove” method’s “success” callback function at the very top, for example:
remove : function(idProduct, idCombination, customizationId, idAddressDelivery){
//send the ajax request to the server
$.ajax({
...
success: function(jsonData) {
//Ematics Module
ematics_blockcart_log(jsonData);
...
}
Uninstallation
To uninstall the module, do the following:
- In your back office go to ‘Modules and Services’.
- Find Ematics module.
- On the ‘Configure’ drop-down press ‘Uninstall’ (alternatively you can just Disable the module).
- When prompted with an alert asking if you want to uninstall this module press ‘Ok’.
Testing
Cookies are used to track unique visitors and to limit the display of the popup. Cookies will need to be cleared to re-test the display of the popup, alternatively you can use Incognito Mode in Chrome.