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/89f5d159ceae6c09c7b50c52f3952be5 to your computer and use it in GitHub Desktop.
Save essmahr/89f5d159ceae6c09c7b50c52f3952be5 to your computer and use it in GitHub Desktop.
{% 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:
{{saw_variant_price | round | times: item.quantity | money }}<br>
<del>{{ saw_variant_compare_at_price | times: item.quantity | money }}</del>
-->
{% endif %}
<div style="text-align: right;" class="saw-extra-note"></div>
<span class="saw-cart-original-total">{{ cart.total_price | money }}</span><br>
<span class="saw-cart-total"></span>
<script>
function SAWOrderNote(note) {
note = note.replace("some text to replace",
"new text");
return note
}
function SAWComplete(res) {
setTimeout(function() {
jQuery(".cart__note-add").click()
}, 500);
if (res.warning_note != "") {
var checkout_selectors = [".purchase-benefits", "input[name='checkout']", "button[name='checkout']", "[href$='checkout']","input[name='goto_pp']", "button[name='goto_pp']", "input[name='goto_gc']", "button[name='goto_gc']", ".google-wallet-button-holder", ".amazon-payments-pay-button", ".alt-payment-list-amazon-button-image", ".additional-checkout-button__logo"];
checkout_selectors.forEach(function(selector) {
jQuery(selector).remove();
})
return
}
setTimeout(function() {
//jQuery(".saw-cart-original-total").remove();
}, 10)
return
}
</script>
{% include 'saw_cart' %}
{% if customer.tags == blank %}
{% else %}
{% endif %}
{% if customer.tags contains 'Wholesale' or customer.tags contains 'wholesale' %}
{% else %}
{% endif %}
{% unless template contains "cart" %}
{% endunless %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment