I have some items that are subscriptions and some are not. I want an if statement that changes the message depending on if the user has a product from a certain collection in their order. Here is my code:
{% assign sub_product = false %}
{% for line in line_items %}
{% for product in collections[‘csa-shares’].products %}
{% if product.title == line.product.title %}
{% assign sub_product = true %}
{% endif %}
{% endfor %}
{% endfor %}
{% if sub_product == true %}
Well, I have a collection of products that are subscriptions and if a user buys one, I don’t want the standard “we are preparing your order for shipping” message. Rather if the product is part of that collection, I would like a different message like "thank you for subscribing to our X membership, you can view your membership details in your account here: " or something like that. But then the rest of my products are non subscription so if an order has only those then the standard message is fine.
Yes. It is possible. We can assign those products line and then edit code in the notification in the settings to show message according to Product type
Ok, thank you for your help, but I don’t really follow. I’m not sure why my code isn’t working in the first place as I think I’m basically doing what you are suggesting.