<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Conditions on cart page</title>
    <link>http://forums.shopify.com/categories/1/posts/30832</link>
    <language>en-us</language>
    <description>Feed for discussion topic Conditions on cart page</description>
    <item>
      <title>Conditions on cart page</title>
      <author>Agnes</author>
      <pubDate>Sun, 08 Nov 2009 15:52:32 +0000</pubDate>
      <link>http://forums.shopify.com/categories/1/posts/30832</link>
      <guid>http://forums.shopify.com/categories/1/posts/30832</guid>
      <description>&lt;p&gt;Hi, I'm new to shopify.&lt;/p&gt;
&lt;p&gt;I hope someone can give me some pointers about my problem:&lt;/p&gt;
&lt;p&gt;In my client's store you have to buy a minimum of 6 products to place an order. This code hides the checkout-button until 6 products are in the cart:&lt;/p&gt;
&lt;pre&gt;{% if cart.item_count &amp;lt; 6 %}

You have to buy at least 6 bottles.

{% else %}
 &amp;lt;input type="submit" value="Proceed to checkout" name="checkout" /&amp;gt;

{% endif %}
&lt;/pre&gt;
&lt;p&gt;BUT: I want an exception to be made for a particular collection of products (which are in themselves smaller sets of products). So I'm trying something like this, but I can't get it working:
&lt;pre&gt;{% if item.title == 'product title 1' or 'product title 2' or 'product title 3' %}
go to checkcout

{% elsif cart.item_count &amp;lt; 6 %}
buy more

{% else %}
 go to checkout

{% endif %}&lt;/pre&gt;
Any ideas? :)&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agnes commented</title>
      <author>Agnes</author>
      <pubDate>Mon, 09 Nov 2009 21:54:42 +0000</pubDate>
      <link>http://forums.shopify.com/categories/1/posts/30832#comment-30881</link>
      <guid>http://forums.shopify.com/categories/1/posts/30832#comment-30881</guid>
      <description>&lt;p&gt;Please, anyone? I got this far:&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;{% for item in cart.items %}
{% if cart.item_count &amp;gt; 5 %} 
{% elsif item.title contains "operative word" %}
    Go to checkout
{% else %}
    You need to purchase at least 6 products
{% endif %}
{% endfor %}&lt;/pre&gt;
But this, of course - beeing a loop - outputs the "checkout"-button and/or message multiple times...&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jamie commented</title>
      <author>Jamie</author>
      <pubDate>Tue, 10 Nov 2009 00:34:20 +0000</pubDate>
      <link>http://forums.shopify.com/categories/1/posts/30832#comment-30887</link>
      <guid>http://forums.shopify.com/categories/1/posts/30832#comment-30887</guid>
      <description>&lt;p&gt;You will have to experiment around with this a bit.... what I would do here, since you are hiding the "proceed to checkout" and you are going to &lt;strong&gt;have&lt;/strong&gt; to use a loop, is put the loop &lt;strong&gt;inside&lt;/strong&gt; the submit button. Use it to effect a class change on the submit button. Then you have something you can work with either through css or javascript.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So to use your example:&lt;/p&gt;
&lt;p&gt;
&lt;pre&gt;&amp;lt;input type="submit" id="{% for item in cart.items %}{% if cart.item_count &amp;gt; 5 %}{% elsif item.title contains "operative word" %} go-to-checkout{% else %}purchase-more{% endif %}{% endfor %}" value="Proceed to checkout" name="checkout" class="button" /&amp;gt;&lt;/pre&gt;
Hope that gives you some ideas!&lt;/p&gt;</description>
    </item>
    <item>
      <title>Agnes commented</title>
      <author>Agnes</author>
      <pubDate>Tue, 10 Nov 2009 19:32:44 +0000</pubDate>
      <link>http://forums.shopify.com/categories/1/posts/30832#comment-30912</link>
      <guid>http://forums.shopify.com/categories/1/posts/30832#comment-30912</guid>
      <description>&lt;p&gt;That did it! You're a lifesaver. &amp;lt;3&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jamie commented</title>
      <author>Jamie</author>
      <pubDate>Tue, 10 Nov 2009 19:47:42 +0000</pubDate>
      <link>http://forums.shopify.com/categories/1/posts/30832#comment-30916</link>
      <guid>http://forums.shopify.com/categories/1/posts/30832#comment-30916</guid>
      <description>&lt;p&gt;Awesome!&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
