Hi @Libi, welcome to the community!
I’m not familiar with the Product catalog in WooCommerce, but if you are seeing the error “Unable to find item” - it’s means the value from your Event’s ProductID is not matching an item in your Product Catalog.
A few troubleshooting tips:
- Check to see if ProductID is a value in your Event data. You can use this snippet {{ event.ProductID }} somewhere in your Template to see that value.
- Go to your Product Catalog (Sidebar → Content → Products) and Search with that ProductID. See if an item shows up - if nothing appears, then that means your Event’s ID isn’t being passed to Klaviyo, see if another variable works or make sure your Product Catalog is properly synced.
- WooCommerce may not be properly syncing your products (to the product catalog) or not properly integrated. Look to the troubleshooting tips here: Getting started with WooCommerce : Troubleshooting
Those are the initial steps I would check, but if those don’t work or you still have issues, I’ll leave this open to other Klaviyo folks who are WooCommerce experts to chime in further.
Hi. Thanks for your answer but it didn’t solve the problem.
I need a code that will Exclude out of stock products from browse abandonment flow in Woocommerce.
The one I found it for Shopify.
Hi. Thanks for your answer but it didn’t solve the problem.
I need a code that will Exclude out of stock products from browse abandonment flow in Woocommerce.
The one I found it for Shopify.
Try this:
{% if event.propertiest'Product ID'] %}
{% for product in collections.all.products %}
{% if product.id == event.propertiest'Product ID'] %}
{% if product.available %}
{# Insert code for displaying product link or details here #}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
This code snippet first checks whether the product ID is available in the event properties, and then loops through all the products in your store. It then checks whether the current product ID matches the event product ID and whether the product is available or not. If the product is available, you can insert the code for displaying the product link or details.
You can add this code to your browse abandonment flow, and it should exclude any out of stock products from the email. Please make sure to replace "Product ID" with the actual property name for the product ID.
The issue was resolved with the Klaviyo tech support. The solution is:
For the Browse abandonment flow:
{% catalog event.ItemId unpublished="cancel" %} <a href="{{ catalog_item.url }}"><img style="width: 200px;" src="{{ catalog_item.featured_image.full.src }}" width="200px" /></a> {% endcatalog %}
For the Price Drop Flow (with started checkout with the item trigger + Price drop trigger)
{% catalog event.product_id unpublished="cancel" %} <a href="{{ catalog_item.url }}"><img style="width: 200px;" src="{{ catalog_item.featured_image.full.src }}" width="200px" /></a> {% endcatalog %}
I followed this guide - How Do I Prevent Browse Abandonment Flow Emails from Showing an Out-of-Stock Product? | Community (klaviyo.com) But with the new code.
Hope this will help someone else as well.
Thank you all for the help <3