thenexus00
10/19/2014 - 10:44 PM

Sign up to different campaigns by detecting what is in the cart

Sign up to different campaigns by detecting what is in the cart

	{module_shoppingcartsummary direction="vertical" collection="cartProducts" template=""}
	{%if cartProducts.itemCount != 0%}
		
		{% assign isCleanLean = false %}
		{% assign isGoodGreenStuff = false %}
		
		{% for collection in cartProducts.items %}
			{% if isCleanLean == false and collection.name contains 'Clean Lean' %}
				{% assign isCleanLean = true %}
			{% endif %}
			{% if isGoodGreenStuff == false and collection.name contains 'Good Green Stuff' %}
				{% assign isGoodGreenStuff = true %}
			{% endif %}
		{% endfor %}
		
		{% if isCleanLean == true and isGoodGreenStuff == false %}
			<div class="hidden"><input type="checkbox" checked="checked" name="CampaignList_52913"> {%comment%}- Good Green Stuff Teasing-{%endcomment%}</div>
		{% elsif isGoodGreenStuff == true and isCleanLean == false %}
			div class="hidden"><input type="checkbox" checked="checked" name="CampaignList_52914"> {%comment%}- Clean Lean Protein Teasing -{%endcomment%}</div>
		{% elsif isGoodGreenStuff == true and isCleanLean == true %}
			div class="hidden"><input type="checkbox" checked="checked" name="CampaignList_52919">{%comment%}- Everything Purchased List -{%endcomment%}</div>
		{% endif %}
					
	{%endif%}