Created
March 24, 2022 22:43
-
-
Save stevem21m/99a05aec890bf60d4a7ebc20a3492aed to your computer and use it in GitHub Desktop.
Revisions
-
stevem21m created this gist
Mar 24, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ {% comment %} This will add all items from your collection to the cart Update you-collection with your collection tag name. {% endcomment %} {% assign collection = collections.your-collection %} {% paginate collection.products by 100 %} <form action="/cart" method="post"> {% if collection.products_count > 0 %} {% for product in collection.products %} {% if product.available %} {% for variant in product.variants %} {% if variant.available %} <input name="updates[{{ variant.id }}]" value="1" type="hidden" /> {% endif %} {% endfor %} {% endif %} {% endfor %} </div> {% endif %} {% if collection.products_count > 0 %} <div style="text-align:center;width:500px;margin-top:20px"> <input class="button" type="submit" value="BUY ALL" /> </div> {% endif %} </form> {% endpaginate %}