Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created April 7, 2017 14:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joe-dempsey/7289685ed7d8a3f127d73a9c1562b13a to your computer and use it in GitHub Desktop.
Save joe-dempsey/7289685ed7d8a3f127d73a9c1562b13a to your computer and use it in GitHub Desktop.
shopify straight to checkout/stay on page.
{% assign send_to_cart = true %}
{% assign send_to_checkout = false %}
{% for tag in product.tags %}
{% if tag contains "no__redirect" %}
{% assign send_to_cart = false %}
{% endif %}
{% if tag contains "send_to_checkout" %}
{% assign send_to_checkout = true %}
{% endif %}
{% endfor %}
{% if send_to_cart == false %}
<input type="hidden" name="return_to" value="back" />
{% endif %}
{% if send_to_checkout == true %}
<input type="hidden" name="return_to" value="/checkout" />
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment