Unlock Your Shopify Product Pages: Dynamic Specs, Filters & Fractional Quantities with Metafields
Hey there, fellow store owners!
I recently stumbled upon a fantastic discussion in the Shopify Community that tackled some really common, yet often puzzling, product page challenges. Our friend @idahospudnut kicked things off, looking for ways to display detailed product specifications and handle tricky fractional quantities for their fabric store. It’s a scenario many of us face, especially when selling items that aren’t just a simple “one-size-fits-all.”
The thread became a goldmine of insights, with community experts jumping in to share practical, actionable solutions. Let's dive into what we learned, because these tips can truly elevate your product pages and streamline your operations on your Shopify store.
Transforming Product Specs with Shopify Metafields
Idahospudnut’s initial request was clear: how to create a neat, organized table of product specifications like "Designer," "Manufacturer," "Fabric Type," and "Fiber Content," similar to a screenshot they shared. The consensus from experts like Easify-Jennifer, Mustafa_Ali, Devcoder, and Ricardo.Roas was unanimous: Shopify product metafields are your best friend here.
Metafields allow you to add custom fields to your products (and other Shopify resources) without cluttering your main product description. This means cleaner data management and a more consistent display across your store.
Step-by-Step: Setting Up & Displaying Dynamic Product Specifications
Here’s how you can implement this, drawing heavily from the excellent guidance provided by Ploqo in the thread, who even built and tested this on a Dawn store:
- Create Your Metafield Definitions:
- Go to your Shopify Admin, then Settings > Custom data > Metafields > Products.
- Click Add definition.
- For each specification you want to display (e.g., Designer, Manufacturer, Fabric type, Fabric width, Fiber content), create a new definition.
- Set the Type to Single line text. If you have many options for a field (like "Themes"), you might consider a "List of values" or even "Reference" metafields, as Jennifer suggested, for easier management.
- For consistency, Ploqo recommended setting the Namespace and key to something like
fabric.designer,fabric.manufacturer, etc. This groups them nicely under afabricnamespace.
- Populate Metafield Values for Each Product:
- Open any product in your Shopify Admin.
- Scroll down to the Metafields section.
- You'll see your newly created metafield definitions. Fill in the relevant values for each product. Tip: Pin the definitions you use frequently so they always appear on your product pages for easy access.
- Display Metafields as a Table on Your Product Page:
- Go to Online Store > Themes > Customize your current theme.
- Navigate to a product template (e.g., Default product).
- Add a new block, choose Custom Liquid. Ploqo suggests placing it right under your product description.
- Paste the following Liquid code into the Custom Liquid block and Save. This code dynamically pulls your metafields and formats them into a clean table. Remember, the
fabricnamespace in the code must match what you set in step 1.{%- liquid assign ns = product.metafields.fabric assign rows = 'designer:Designer,manufacturer:Manufacturer,fabric_type:Fabric Type,fabric_width:Fabric Width,fiber_content:Fiber Content' | split: ',' assign has_specs = false for row in rows assign key = row | split: ':' | first if ns[key].value != blank assign has_specs = true break endif endfor -%} {%- if has_specs -%}{%- for row in rows -%} {%- assign parts = row | split: ':' -%} {%- assign key = parts[0] -%} {%- assign value = ns[key].value -%} {%- if value != blank -%}
{%- endif -%} {%- endif -%} {%- endfor -%}{{ parts[1] }} {{ value }}
Once you’ve got this set up, you’ll see a beautiful, dynamic table on your product pages, just like this:
Making Your Product Specs Clickable Filters
Idahospudnut hit a snag trying to make these spec values clickable, initially thinking they needed to create collections for each designer or fabric type. This is a common misconception! As Ploqo wisely pointed out, those links should be filters, not collections.
Shopify’s free Search & Discovery app is the key to turning your metafield values into powerful, clickable filters that help customers find exactly what they’re looking for.
Step-by-Step: Activating Metafield Filters
- Install the Shopify Search & Discovery App: If you don't have it already, search for it in the Shopify App Store and install it. It's a first-party app, so it integrates seamlessly.
- Turn Each Metafield into a Storefront Filter:
- In your Shopify Admin, go to Apps > Search & Discovery.
- Click on Filters.
- Click Add filter, then Select source.
- Type your metafield definition name (e.g., "Designer") and pick the entry marked Product metafield.
- Repeat this for each metafield you want to make clickable: Manufacturer, Fabric type, Fabric width, Fiber content.
Once activated, clicking a value in your product spec table (like "Rifle Paper Co." for Designer) will now open a filtered product list, showing only products by that designer. It's super effective for navigation!
A quick troubleshooting tip from Ploqo: If your links aren't working, double-check that the value in the product metafield matches exactly (including spaces and capitalization) what you're expecting. Also, give the storefront a minute to update after adding new filters.
Mastering Fractional Quantities for Fabric & Similar Products
Idahospudnut's second big question was about managing quantities like "1 1/4 yards" with a dropdown for fractional amounts and a "Contact me if short" option. This is a classic challenge because Shopify's native quantity field usually works with whole numbers.
MayraApps rightly cautioned about careful inventory flow testing if you treat 1 unit as 1/4 yard, ensuring consistency from product page to fulfillment. Ploqo then provided an elegant solution that addresses this directly:
Step-by-Step: Implementing Fractional Quantity Selection
- Sell the Product by the Smallest Unit (e.g., 1/4 Yard):
- In your product settings, set your price per 1/4 yard. For example, if fabric is $13.80/yard, price it at $3.45.
- Track your inventory in 1/4-yard units. So, 12 1/4 yards of fabric becomes 49 units in your inventory.
- Add the Custom Quantity Block to Your Product Template:
- Go to Online Store > Themes > Customize, open your Product template.
- Add another Custom Liquid block, placing it just above your "Add to cart" button.
- Paste the following code. This code creates two dropdowns (for whole yards and fractional parts) and the "Contact me if short" selector. It also hides Shopify's default quantity selector.
{%- liquid assign v = product.selected_or_first_available_variant assign units = v.inventory_quantity if units < 0 assign units = 0 endif assign whole_stock = units | divided_by: 4 assign frac_stock = units | modulo: 4 -%}{%- if v.inventory_quantity > 0 or v.inventory_policy == 'continue' -%}{{ whole_stock }}{% if frac_stock > 0 %} {{ frac_stock }}/4{% endif %} yards in stock
{%- endif -%}Yards
With this setup, the whole yards and fractions combine into a single quantity for the cart. The "Contact me if short" choice is saved as a note on the line item and order, making fulfillment much clearer. This also ensures your stock levels are accurately reflected.
It's worth noting that if you prefer a no-code solution for fractional quantities, apps like Fabric Counts, Measura, or Product Customizer Pro can achieve similar results with their pickers.
What a thread! It really shows the power of the Shopify community. By leveraging native Shopify metafields, the free Search & Discovery app, and a bit of custom Liquid, you can create a highly functional, user-friendly, and maintainable product experience. Whether you're selling fabric by the yard or any other product with unique specifications and complex quantity needs, these strategies are incredibly valuable. It's all about making your store work smarter, not harder!








