Skip to main content
All CollectionsTriggersAdvanced trigger control
Do not send if all products in a cart have a value of 0
Do not send if all products in a cart have a value of 0

Use this Trigger script to check that at least one product in a cart has a valid price before sending.

Updated over a year ago
result.proceed=true;
var prods = helpers.getProducts();
var zeroPrice = helpers.productsMatch(prods, 'uv', [0]);
console.log("Zero Prices - " + zeroPrice);
console.log("Total Products - " + prods.length);
console.log("Are they the same? " + (prods.length == zeroPrice).toString())
if (prods.length == zeroPrice) {
result.proceed = false;
}

Did this answer your question?