<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ivete Tecedor</title>
    <description>jekyll repo for ivetetecedor.com</description>
    <link>https://ivetetecedor.com/</link>
    <atom:link href="https://ivetetecedor.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Fri, 25 Jul 2025 20:34:18 +0000</pubDate>
    <lastBuildDate>Fri, 25 Jul 2025 20:34:18 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Use Shopify Product Metafield Data for Filters in Theme</title>
        <description>&lt;p&gt;In a recent Shopify project, I set up custom Product Metafields to store additional product information, and then exposed them in the theme so that customers could filter results by those metafield values.&lt;/p&gt;

&lt;p&gt;It wasn’t as straight-forward as I expected, so I’m writting up this tutorial to show the steps to achieve this.&lt;/p&gt;

&lt;h2 id=&quot;set-up-product-metafields&quot;&gt;Set Up Product Metafields&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;/shopify-product-metafields&quot;&gt;Create your Product Metafield&lt;/a&gt; in whatever configuration you need to store your data. Then, check off the “Use as a filter” option at the bottom of the Metafield definition form:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-filter-option.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Metafield Filter Option&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once you have your Metafield set up, go into your products and update them to add values into this field.&lt;/p&gt;

&lt;p&gt;The &lt;a href=&quot;https://help.shopify.com/en/manual/shopify-admin/productivity-tools/bulk-editing&quot; target=&quot;_blank&quot;&gt;Shopify Product Bulk Update feature&lt;/a&gt; is really handy for this, just remember to expose the metafield by clicking the “Columns” button at the top right so you can see the field!&lt;/p&gt;

&lt;h2 id=&quot;install-search--discovery-app&quot;&gt;Install Search &amp;amp; Discovery App&lt;/h2&gt;

&lt;p&gt;If you don’t already have it installed in your shop, install the &lt;a href=&quot;https://apps.shopify.com/search-and-discovery&quot; target=&quot;_blank&quot;&gt;free Shopify Search &amp;amp; Discovery App&lt;/a&gt;. Then open the App and click on Filters:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-search-discovery-filters.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Search &amp;amp; Discovery App Filters Screen&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Click “Add filter” at the top to open the form to create a new filter, then click “Select source”, which will open up a new modal:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-filter-modal.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Search &amp;amp; Discovery Add Filter Source Modal&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Each row in this modal is a piece of structured data in your store that can be used for filtering. Find your Metafield in this list and select it.&lt;/p&gt;

&lt;p&gt;For this example, I am using the “Country of Origin” field, which is a single-line text field with a pre-defined list of 3 options to choose from. Once you select the Metafield you want to use, the form will update showing the existing &lt;em&gt;values&lt;/em&gt; of that field:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-search-filter-dropdown.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Search &amp;amp; Discovery Filter for Drop Down Metafield&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Once you click Save, this new filter will be displayed in your list of filters:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-search-discovery-filters-list.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Search &amp;amp; Discovery Filter List&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;thats-it-you-now-have-a-metafield-filter&quot;&gt;That’s it, You Now Have a Metafield Filter!&lt;/h2&gt;

&lt;p&gt;After saving your filter, when you go to your website and view a collection whose products have values in this new Metafield, you’ll now see a new filter in the filters area:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-filter-theme.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Metafield Filter on Horizon Theme&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The above screenshot is using the &lt;a href=&quot;https://themes.shopify.com/collections/horizon-themes&quot; target=&quot;_blank&quot;&gt;Horizon theme&lt;/a&gt; without any customization.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/dawn-theme-filters.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Metafield Filter on Dawn Theme&quot; /&gt;&lt;/p&gt;

&lt;p&gt;And here’s a screenshot of the same data displayed in the &lt;a href=&quot;https://themes.shopify.com/themes/dawn/presets/dawn&quot; target=&quot;_blank&quot;&gt;Dawn theme&lt;/a&gt; without any customizations.&lt;/p&gt;
</description>
        <pubDate>Sun, 20 Jul 2025 00:00:00 +0000</pubDate>
        <link>https://ivetetecedor.com/shopify-product-metafields-frontend-filters/</link>
        <guid isPermaLink="true">https://ivetetecedor.com/shopify-product-metafields-frontend-filters/</guid>
        
        
        <category>Shopify</category>
        
      </item>
    
      <item>
        <title>Add structured data to Shopify products with Product Metafields</title>
        <description>&lt;p&gt;Shopify’s native product fields are probably sufficient for 95% of businesses selling simple products, but for some businesses, the product catalog could benefit from having more structured data defined at the product level.&lt;/p&gt;

&lt;p&gt;That’s why Shopify introduced &lt;a href=&quot;https://help.shopify.com/en/manual/custom-data/metafields&quot;&gt;Product Metafields&lt;/a&gt; in 2021, and has been iterating on the feature ever since.&lt;/p&gt;

&lt;p&gt;From Shopify’s documentation, here are some examples of the type of product data that can be stored in metafields:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;part numbers&lt;/li&gt;
  &lt;li&gt;color swatches&lt;/li&gt;
  &lt;li&gt;launch dates&lt;/li&gt;
  &lt;li&gt;related products&lt;/li&gt;
  &lt;li&gt;blog post summaries&lt;/li&gt;
  &lt;li&gt;files for download&lt;/li&gt;
  &lt;li&gt;lists of ingredient&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I write this in June of 2025, there are &lt;a href=&quot;https://help.shopify.com/en/manual/custom-data/metafields/metafield-definitions/metafield-types&quot;&gt;26 different metafield content types available&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For most shops, the most common data types you’ll use are probably &lt;em&gt;text&lt;/em&gt; and &lt;em&gt;color&lt;/em&gt;.&lt;/p&gt;

&lt;h2 id=&quot;example-product-metafield-setup&quot;&gt;Example Product Metafield Setup&lt;/h2&gt;

&lt;p&gt;Let’s say that a store selling clothes wants to display these additional details on each product:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Country of Origin&lt;/li&gt;
  &lt;li&gt;Machine Washable&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;product-metafield-with-drop-down-options&quot;&gt;Product Metafield with Drop-down Options&lt;/h3&gt;

&lt;p&gt;For the Country of Origin field, we’re obviously storing text, but if you were to allow users to type into a free-form text field, you’ll end up with messy duplicates like “USA” vs “United States” versus “US”. So instead of a plain text field, you’ll want to set up a drop-down field with a predefined set of options for to user to choose from.&lt;/p&gt;

&lt;p&gt;To open the Metafield definitions screen, click on Settings&amp;gt;Metafields and metaobjects&amp;gt;Products, which will take you to a list of all existing Product Metafields. If you haven’t yet made any, it’ll look like this:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/empty-shopify-metafields.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Empty list of Shopify Product Metafields&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Click “Add definition” and enter the text you want displayed in the Product admin for this field, in this case, “Country of Origin”. You can add text in the “Description” field if you’d like but it’s not required.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/create-product-metafield.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Product Metafield Form&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Then click “Select type” to open the field data type options drop down:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-data-types.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield Data Type Drop Down&quot; /&gt;&lt;/p&gt;

&lt;p&gt;In this case, we’ll choose “Single Line Text”, since the values will always be short (ie country names). If we needed to store longer text, we’d choose “Multi-line text”, or to store numbers, choose Integer or Decimal, etc.&lt;/p&gt;

&lt;p&gt;Once you’ve clicked “Single Line Text”, the form will update with that selection and two new options, “One value” or “List of values”:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-one-value-list-values.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield One Value vs List of Values&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The wording on these two options maybe could be clearer, but essentially these two options mean “allow the user to enter one piece of text” vs “allow the user to enter a list of text”. In other words, do you want the field to store text like “USA” for a Country of Origin field, or text like “Milk, Sugar, Butter” for a field that stores a list of ingredients.&lt;/p&gt;

&lt;p&gt;Once you choose “One value”, some more options appear below:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-single-line-text-options.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield Single Line One Value Options&quot; /&gt;&lt;/p&gt;

&lt;p&gt;All of these additional options are optional, but in our case, we’ll be choosing “Limit to preset choices” in order to create our drop down menu of countries for the uer to choose from. Once you’ve checked that checkbox, a field appears to allow you to enter the options:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-drop-down-options.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield Single Line One Value Options&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Type all the options you want to have in this field, click save, and you’re done!&lt;/p&gt;

&lt;p&gt;In the Admin, the product will now display this new field in the Product metafields section, and clicking into the field will display the drop down with the options you set up:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-product-metafield-dropdown.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield with Drop Down Options&quot; /&gt;&lt;/p&gt;

&lt;h3 id=&quot;product-metafield-with-truefalse-values&quot;&gt;Product Metafield with True/False Values&lt;/h3&gt;

&lt;p&gt;In the case of the “Machine Washable” field, the only valid options are “Yes” and “No”, which in programmer-speak is a boolean value – the only acceptable options are True (“Yes”) and False (“No”).&lt;/p&gt;

&lt;p&gt;Shopify shows this data type as “True or false” in the “Select type” drop down, because they are trying to be friendly to non-developers, but if you type “boolean” into the search, it understands what you are looking for:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-metafield-true-false-field.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify Product Metafield with true/false values&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Since this is a much simpler type of field with only two valid options, there are no additional configuration options after choosing it from the drop down, you can just click Save after choosing it.&lt;/p&gt;

&lt;p&gt;Now on the Product admin screen, the new Metafield is displayed and when you click into it, the options True and False are displayed as radio buttons, allowing only one selection to be made:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/image/shopify-product-metafield-true-false.png&quot; width=&quot;840&quot; height=&quot;326&quot; alt=&quot;Shopify true/false Metafield in Product Admin&quot; /&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 25 Jun 2025 00:00:00 +0000</pubDate>
        <link>https://ivetetecedor.com/shopify-product-metafields/</link>
        <guid isPermaLink="true">https://ivetetecedor.com/shopify-product-metafields/</guid>
        
        
        <category>Shopify</category>
        
      </item>
    
  </channel>
</rss>
