Skip to content

Instantly share code, notes, and snippets.

@chrisjhoughton
Last active September 9, 2023 07:56
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save chrisjhoughton/893f536698e2c27cb7f5 to your computer and use it in GitHub Desktop.
Save chrisjhoughton/893f536698e2c27cb7f5 to your computer and use it in GitHub Desktop.
Remove a Shopify cart attribute
{% if cart.attributes.yourCartAttribute %}
<script>
$.ajax({
type: 'POST',
url: '/cart/update.js',
data: 'attributes[yourCartAttribute]=',
dataType: 'json'
});
</script>
{% endif %}
@skillmatic-co
Copy link

@alpriest @emcmanus by setting the value to null, it doesn't remove the key for me from the order. It just sets the key's value to null. Anyway to actually remove the entire note attribute via the API?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment