getEcommerceItems

❗️

Deprecated

This method is no longer recommended.

The getEcommerceItems() method returns items added to the cart.

Syntax

getEcommerceItems()
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>

Returns

An object containing items added to the cart.

Format: Object<productSKU, Array[productSKU, productName, productCategory, price, quantity]>

Type: object

Example

To get items added to the cart:

_paq.push([  
  function () {  
    console.log(this.getEcommerceItems());  
  },  
]);
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>
getEcommerceItems(): Promise<object>

A sample of the return value:

{  
    "584340": ["584340", "Specialized Stumpjumper", "Mountain bike", 5000, 1],  
    "460923": ["460923", "Specialized Chamonix", "Helmets", 200, 2],  
}

Notes

  • The cart with added items is not stored in local storage. Make sure to add all items again after the page reloads.

Related methods