Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save dylanjhunt/696e24b4a9b49f9290ee81aed419a2c9 to your computer and use it in GitHub Desktop.

Select an option

Save dylanjhunt/696e24b4a9b49f9290ee81aed419a2c9 to your computer and use it in GitHub Desktop.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
{% assign found_title = false %}
{% for item in checkout.line_items %}
{% if item.variant.id == 7387208286253 %}
{% assign found_title = true %}
{% endif %}
{% endfor %}
{% if checkout.subtotal_price > 10000 and found_title == false %}
<script>
$( document ).ready(function() {
var variantId = 7387208286253;
jQuery.post('/cart/add.js', {
quantity: 1,
id: variantId
});
setTimeout(
function() {
window.location.reload(true);
}, 1000);
});
</script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment