Before you start
By default, abandonment emails include both in‑stock and out‑of‑stock items.
To hide out‑of‑stock products, Fresh Relevance must be collecting stock quantity or stock status for your products.
You can combine trigger rules with cart layout filters to prevent sending emails with only out‑of‑stock items.
Method 1: Use the Products rule
In the left side menu, go to Triggers.
Expand the Show options (three dots) menu for the trigger you want to edit and select the Edit icon.
Expand the Raised Browse/Cart Abandon Signal rule group and drag the Products rule to the top of the rule tree on the right, so it's the first entry.
Select the rule to configure and set the options to
all of
Stock
Out of Stock
respectively.
If a cart matches that criteria, this means all of the items in it are of out of stock, so you don't want to send.
Select the Add Trigger Program tab and drag the Do Nothing trigger into the Yes branch. Then add any other rules/triggers to the No branch.
Method 2: Check stock before sending each stage
Use this method to re‑check product stock at send time in a multi‑stage trigger:
Enable the Refresh product data at send time option for the stage.
Add the following script to the script box for the stage:
result.proceed = false;
if (helpers.checkCartStock() === true){
result.proceed = true;
}
Example for the second stage email:
Method 3: Filter the cart layout
To hide out‑of‑stock products in the cart layout:
modify the product FOR loop and append the below IF statement:
{% for product in products if product.stock > 0 %}
If you use an existing filter to limit products, append the IF statement:
{% for product in products|limit(1)|reverse if product.stock > 0 %}
This ensures only products with stock greater than zero are displayed.




