I am using Impulse and can create a Metafield but it is showing universally. How can I apply it to certain products only? Looked everywhere including the Impulse FAQs page but it still applies universally. I want different ones for different types of products. Thank you in advance!
Hello @jtsjlj140505
If you are using an impulse shopify theme and want to apply a meta field to certain products only you will need to modify the theme code.
-
Online store > themes>actions<edit code
-
In the code editor, locate the file where the meta field is being displayed. Typically it would be in the liquid file responsible for rendering the product
-
Look for a loop or condition that determines how products are displayed. This could be a ‘for’ loop or an ‘if’ statement.
-
Within the loop or condition, check for the type or any other attribute that distinguishes the products you want to apply the meta fields too.
-
Wrap the code that renders the metafield within an ‘if’ statement that checks for the desired conditions.
{% if product.type == 'desired_product_type' %}
{% endif %}
Replace ‘desired_product_type’ with the specific product type or attribute, you want to target.
- Save the changes and test the Metafield’s display on the relevant product pages.
you can ensure that the Metafield is only displayed for the products that meet the specified condition. Remember to check the specific liquid files related to product rendering, such as product.liquid, product-template.liquid, or any customized section files that handle product information.