I am hoping someone will be able to help me work out why the background colour held in the metafield is not displaying correctly with the following output;
Your namespace for the metafields really is “Product”?
Would really want to see a link where this is shown to rule out that it’s not other CSS that’s cascading over what’s set here. Are you able to share it?
Have you done the sanity check of just outputting the value of the metafield? If so and it does show the hex colour it adds some weight to it being other CSS at play.
I removed the {% assign product_color = product.metafields.Product.flower_colour %} and just used the {% product.metafields.Product.flower_colour %} instead but still didn’t work.
Since the output is correct must have something to do with the style??
As per my previous post the output was the hex colour code inside [‘colour’]. Hence the first part was to remove this, the second part was to handle items that had multiple colours, finally was to handle any items that had no colour applied by if statement.
This obviously worked for me as the output I receive made sense. You may need to output just the “colour” and see if that works for you or if you have other output first.