@lindsey.homenick
You can check if a product exists in the cart in Shopify by using Shopify Liquid code.
Here is an example code snippet to check if a specific product exists in the cart:
1 2 3 4 5 |
{% for item in cart.items %} {% if item.product.title == 'Product Title' %} <p>The product is already in the cart</p> {% endif %} {% endfor %} |
Replace 'Product Title' with the title of the product you are looking for. This code will loop through all items in the cart and check if the product title matches the one you specified. If a match is found, it will display a message indicating that the product is already in the cart.