Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

At the top, add:
{% include 'buyx-product' with product %}
{% include 'buyx-price-min' with product %}
The following blocks are original code, if exist, and replacement code.
====
{% for option in product.options %}
Before using any of the variables below, add this line, once per file
{% include 'buyx-price-min' with product %}
The following blocks are original code, if exist, and replacement code.
Note that instead of product.price, there might be variations like item.price, or product-block.price etc.
====
theme.liquid
{% if customer.tags == blank %}{% else %}
<script>
{% if template != 'cart' %}
jQuery(function(){
jQuery('body').on('click', "input[name='checkout'], input[value='Checkout'], button[name='checkout'], input[name='goto_pp'], button[name='goto_pp'], input[name='goto_gc'], button[name='goto_gc'], [href$='checkout']", function(e){
e.preventDefault();
window.location = "/cart";
{% include 'saw_compute_discount' with item.product %}
{% include 'saw_variant' with item.variant %}
{% if saw_has_discount == false or saw_variant_price >= saw_variant_compare_at_price %}
{{ item.price | money }}
{% else %}
{{ saw_variant_price | round | money }}<br>
<del>{{ saw_variant_compare_at_price | money }}</del>
<!-- line_price:
.sam-hidden {
display: none !important;
}
.sam-cart-total, .sam-discount-info, .sam-notes {
background-color: #7CD5FA;
color: #000000;
padding: 0px !important;
}
<!-- Add to cart.liquid -->
{% if customer %}
{% else %}
<div style="text-align: center;">
<b><a href="/account/login">Sign in</a></b> or
<b><a href="/account/register">Create a free Account</a></b>
to use your Membership benefits.
</div>
{% endif %}
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">
{% include 'sam_account' %}
Parallax
<li class="mm-label">
<p class="mm-counter"><span class="sam-cart-original-total">{{ cart.total_price | money }}</span> &nbsp; <span class="total sam-cart-total"></span></p>
<a href="/cart">
<strong>{{ 'layout.general.subtotal' | t }}</strong> &nbsp; <span class="sam-discount-info" style="text-transform: none;"></span>
</a>
<input type="hidden" name="discount" id="discount" value="" style="display: none;"/>
</li>
<!-- After {{ page.content }}, add -->
{% if page.title == 'Get Rewards' %} <!-- use same title as the rewards page you created -->
{% include 'sam_account' %}
{% endif %}