Skip to content

Instantly share code, notes, and snippets.

@essmahr
Created February 5, 2018 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save essmahr/9b85316a147c14774009cbeed4c43fe7 to your computer and use it in GitHub Desktop.
Save essmahr/9b85316a147c14774009cbeed4c43fe7 to your computer and use it in GitHub Desktop.
Quantity field:
{% unless item.variant.inventory_management == blank or item.variant.inventory_policy == 'continue' %} max="{{ item.variant.inventory_quantity }}" {% endunless %}
<!-- OPTIONAL, only if you want members to purchase directly with Benefits, instead of a regular checkout.
Add to cart.liquid, after total price:
-->
<div id="sam-benefits-info" class="sam-hidden">
Cart total: <span class="sam-cart-total-benefits"></span><br>
You have: <span class="sam-current-benefits"></span><br>
</div>
<div id="sam-not-enough-benefits" class="sam-hidden">
Not enough points to cover all items, please pay with card.
<br>
<a href="/collections/point-products" class="" onclick="
jQuery.ajax({
cache: false,
type: 'POST',
url: '/cart/clear.js',
}); return true;
">Purchase more points</a>
<br>
</div>
==
Add purchase button
<script>
window.sam_redirect_url = "/pages/thank-you"
</script>
<input type="button" id="purchase-benefits" name='checkout' class="sam-hidden purchase-benefits btn cart__checkout" data-qty-pattern="updates_{key}"
value="Purchase with Credits" />
==
At the end, add
{% include 'sam_cart_benefits' %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment