Dawn Theme 11: Solid button background color dynamic based on meta object / field

Topic summary

Goal: Dynamically set the product page’s solid button background color per product using a color stored in a product group metaobject, with a fallback to the theme’s default button color.

Details:

  • Each product references a product group metaobject that includes a unique hex color (e.g., #88D189).
  • The color value is accessible in Liquid on product pages.
  • Request is to override the theme setting (“Solid button background color”) so that: if the metaobject/metafield color exists, use it; otherwise, use the theme’s configured color.

Technical context:

  • Metaobject/metafield: Shopify’s custom data structures for storing additional product/group data.
  • Liquid: Shopify’s templating language for outputting/storefront logic.

Status: No implementation or code solution provided yet; guidance requested and discussion remains open.

Summarized with AI on January 22. AI used: gpt-5.

My products have a product group metaobject allocated to them, inside that meta object there is product group information including a unique color for each group, its in this format: #88D189

I can call it inside product pages / liquid etc, but how can I replace the theme color settings and make it to follow such color if it exists?

I’m specifically talking about the color of the buttons which come from " Solid button background color " in the theme settings.

How can I override this color, with a code saying if the metaobject / field exists then use metaobject/metafield color, if not then use the them setting color.

Thank you!