list
In Mapp Intelligence you can analyze in detail which products in your catalog are viewed.
"List" is typically set as status on a product overview page.
Methods
The list object contains the following four methods, which are contained in the objects data and parameter:
- set: Overwrites all existing values.
- add: Overwrites only the corresponding values.
- get: Returns the current configuration.
- remove: Removes the current configuration or individual values.
data
set
/**
* @param {{
* id: string,
* [cost=0]: number,
* [quantity=0]: number,
* [variant=""]: string,
* [soldOut=false]: boolean,
* [parameter={}]: {[number]: string},
* [category={}]: {[number]: string}
* }[]} data
*
* @returns {wtSmart.product.list.data}
*/
wtSmart.product.list.data.set(data);
JS
add
/**
* @param {{
* id: string,
* [cost=0]: number,
* [quantity=0]: number,
* [variant=""]: string,
* [soldOut=false]: boolean,
* [parameter={}]: {[number]: string},
* [category={}]: {[number]: string}
* }[]} data
*
* @returns {wtSmart.product.list.data}
*/
wtSmart.product.list.data.add(data);
JS
get
/**
* @returns {{
* id: string,
* cost: number,
* quantity: number,
* variant: string,
* soldOut: boolean,
* parameter: {[number]: string},
* category: {[number]: string}
* }[]}
*/
wtSmart.product.list.data.get();
JS
remove
/**
* @param {number[]} [removeList]
*
* @returns {wtSmart.product.list.data}
*/
wtSmart.product.list.data.remove(removeList);
JS
Example
var product = {
id: 'ABC-123',
cost: 99.90,
quantity: 2,
soldOut: false,
variant: 'green',
parameter: {
1: 'L'
},
category: {
1: 'tops',
2: 'noname'
}
};
// set product list data
wtSmart.product.list.data.set([product, product2]);
// add product list data
wtSmart.product.list.data.add([product3, product4]);
// get product list data
var data = wtSmart.product.list.data.get();
// remove all product list data
wtSmart.product.list.data.remove();
// remove only the first (product) product list data
wtSmart.product.list.data.remove([1]);
JS
parameter
set
/**
* @param {{[number]: string}} data
*
* @returns {wtSmart.product.list.parameter}
*/
wtSmart.product.list.parameter.set(data);
JS
add
/**
* @param {{[number]: string}} data
*
* @returns {wtSmart.product.list.parameter}
*/
wtSmart.product.list.parameter.add(data);
JS
get
/**
* @returns {{[number]: string}}
*/
wtSmart.product.list.parameter.get();
JS
remove
/**
* @param {number[]} [removeList]
*
* @returns {wtSmart.product.list.parameter}
*/
wtSmart.product.list.parameter.remove(removeList);
JS
Example
// set product list parameter
wtSmart.product.list.parameter.set({
1: 'bar'
});
// add product list parameter
wtSmart.product.list.parameter.add({
7: 'foo.bar'
});
// get product list parameter
var data = wtSmart.product.list.parameter.get();
// remove all product list parameter
wtSmart.product.list.parameter.remove();
// remove only product list parameter 7
wtSmart.product.list.parameter.remove([7]);
JS