To answer your questions:
- You should only need one checkout button, see my code below.
- Your inner for loop should be
{% for item in cart.items %}
, not{%for cart.items %}
- See code below.
Try something like this:
{% assign show_checkout_button = true %}
{% for item in cart.items %}
{% if item.product.tags contains 'SampleTag' and item.quantity <= 49 %}
{% assign show_checkout_button = false %}
<p>You will need to purchase more than 50 of the product "{{ item.product.title }}"</p>
{% endif %}
{% endfor %}
{% if show_checkout_button %}
<!-- show checkout button -->
{% endif %}
The above code loops through each product in the cart, and if the product has the tag "SampleTag" and a quantity less than 50 it shows an error message instead of the checkout button.