I am trying to add a product to cart automatically based on spending tiers. The first tier is the one I am having an issue with because I am adding a product with 2 variants and the code I have is not correctly accounting for if the product is already in the cart.
{% assign lineItemProductIDs = cart.items | map:line_item.product_id %}
{% if cart_total >= 3900 and cart_total < 12900 %}
{% if lineItemProductIDs == ‘555555’ %}
This cart already contains 555555 {% else %} {% assign queue = '[{ variant_id: 123456, quantity_id: 1 }]' %} {% endif %} {% elsif cart_total >= 12900 %}
…