Trigger (cart)
Description
Define settings to display trigger to add an item to the cart or delete it from the cart.
itemTrigger
can be extended to customize display of trigger per result item in search page or cart item in box:
-
cartItemTrigger: customize trigger displayed in cart box
-
resultItemTrigger: customize trigger displayed in search page
Default value
itemTrigger: {
selector: 'h4',
position: 'afterbegin',
iconAdd: 'pushpin',
iconDelete: 'remove',
isLabel: false,
labelAdd: 'Add to cart',
labelDelete: 'Remove from cart',
template: '{{>icon-block}} {{>label-block}}',
}
Examples
Display different icons for triggers. In search page insert trigger as first child of DOM element with cart-trigger
class.
resultItemTrigger: {
iconDelete: 'star',
selector: '.cart-trigger',
},
cartItemTrigger: {
iconDelete: 'remove'
}
See also
-
iconAdd: Define icon to display within trigger to add an item to the cart.
-
iconDelete: Define icon to display within trigger to remove an item from the cart.
-
isLabel: If set to true display label within item trigger, in other way display it as HTML title attribute.
-
labelAdd: Define a text to display within trigger to add an item to the cart.
-
labelDelete: Define a text to display within trigger to remove an item from the cart.
-
position: Define relative position to
selector
element where trigger will be inserted. -
selector: Define CSS selector of element where trigger will be inserted in relative position to it.
-
template: Define template used to display item trigger.