Skip to main content
All CollectionsIntegration with Shopify shopsTroubleshooting and navigating common issues
Can I use metafields and not Shopify tags for the "Genders" settings?
Can I use metafields and not Shopify tags for the "Genders" settings?

Learn how to sync your metafields with the "Genders" settings in Fit Quiz

Updated over 7 months ago

The "Genders" settings play an important role both in making sure that the recommendations are correct and shoppers are asked the right questions in Fit Quiz. It's therefore important to set the genders correctly.

By default, our "Genders" screen uses Shopify tags. Here's what you need to do, if you're using metafields instead of Shopify tags.

Please add the following snippet at the top of your product template and update it to match your metafield definition for genders.

<script>
// Metafield definition looks like this, so adjust that based on your configuration
// {{ resource.metafields.namespace.key }}
let gender = {{ product.metafields.custom.gender | json }}

// We accept gender as 'm', 'f' or 'u', so if you store genders in your local language, please make sure you translate them to one of the three accepted values e.g.
if (gender == 'kvinde') { gender = 'f' }

// Assign the value to our `window.easysize_globals` and set the product_gender there. This allows you to override our app configuration
window.easysize_globals = {
product_gender: gender
}
</script>

In the example above, a shop uses kvinde for female items. Therefore, they shall map it to f, as it's the accepted value for female/womens items.

For example, if your shops uses herre for male items, you would need to update the script above and add/replace if (gender == 'kvinde') { gender = 'f' } with if (gender == 'herre') { gender = 'm' }.

Where can I find the product template?

You can find your product template in the code section of your theme. 

Simply navigate to "Themes", click the "Settings" (three dots) and "Edit Code":

From there, you can filter the files by typing in 'product' and you should find either a product.liquid or main-product.liquid section where you can add the above snippet.

What should I do with the "Genders" screen in Fit Quiz?

We recommend choosing the 'Only unisex' option. This setting will be overwritten by your code snippet. However, should the snippet fail to recognise the gender, the unisex option will act as a failsafe, allowing Fit Quiz to still work correctly by asking customers for their preferred gender items.

Did this answer your question?