This tutorial is outside Shopify support if your experience errors or issues. If you need direct assistance, you can contact me and I will see what I can do to help.
- Metafields: https://shopify.dev/api/liquid/objects/metafield
- Color Object: https://shopify.dev/api/liquid/objects/color
Adding Color Metafield
- Create the color metafield
Create the color Metafield in the Admin under Settings > Metafields
- Add the definition for the metafield
Enter the name, namespace, description and type.
- Note the metafield full name
Write down the full metafield name for direct reference
- Duplicate and Edit Code
Be sure to duplicate your theme and then edit the code on the new copy of your theme.
- Edit the Product template
Depending on what you are hoping to code. Try to find the product-template.liquid file to add code. Use the code refence below to add to the theme.
- Test changes
Edit a product to test the code changes and be sure to preview the theme you edited.
Support more tutorials like this: