Can you alter a metafield value based on checkbox status?

Gonkas
Shopify Partner
11 0 1

Hi,

 

Would like to know if it is possible to change a metafield value from a checkbox status.

For example:

<p>Subscribe email?  <input type="checkbox" id="email" name="mail"
checked>
{% assign product.metafields.my_namespace["my_key"].value = email.checked %}

 Cheers,

Gonkas

Replies 0 (0)