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/fae6a429ccfcaed9fcf71edef39fcc12 to your computer and use it in GitHub Desktop.
Save essmahr/fae6a429ccfcaed9fcf71edef39fcc12 to your computer and use it in GitHub Desktop.
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";
});
});
{% endif %}
jQuery(function(){
jQuery('body').on('click', "[href$='checkout']", function(e){
e.preventDefault();
window.location = "/cart";
});
});
</script>
{% endif %}
<!-- product prices -->
{% include 'saw_compute_discount' with product %}
{% if saw_has_discount == false or saw_product_price >= saw_product_compare_at_price %}
<!-- original prices here -->
{% else %}
{{ saw_product_price | money }}
<del>{{ saw_product_compare_at_price | money }}</del>
{% endif %}
<!-- variant prices -->
{% include 'saw_compute_discount' with product %}
{% include 'saw_variant' with variant %}
{% if saw_has_discount == false or saw_variant_price >= saw_variant_compare_at_price %}
<!-- original prices here -->
{% else %}
{{ saw_variant_price | money }}
<del>{{ saw_variant_compare_at_price | money }}</del>
{% endif %}
{%- include 'saw_product_json' with product -%}
{{- saw_json -}}
{{- saw_json | escape -}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment