Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hey all, Now bear with me i will try to be as clear as I can.
I currently allow the user to filter my collection pages based on the sizes of the products
(Example: 56mm, 57mm, 60mm etc....)
On each of the product pages i tag the products like "Size_56mm" and thats how that works.
Now, to display the product details to the customer im using Metafields, (one for size, one for weight, one for material/colour etc...). To avoid me duplicating information (putting the size "56mm<sup>3</sup>" in the metafield AND the tags) I would like to make FLOW so that when the product inventory changes it checks to see if the product.metafields.custom.size contains a value and if it does it would add a tag to that product (I can do that and its easy enough) but the hard bit is getting the value from the metafield and manipulating it into something that can be filtered.
I need to turn the metafield value of "56mm<sup>3</sup>" into "Size_56mm"
Hope all of this makes sense.
So first, I would avoid doing this on inventory change. That is VERY frequent and not necessary as this kind of info shouldn't change that often.
As to the question, there are a lot of ways to do this in liquid. Maybe the easiest way, assuming you have a product metafield and just need "56mm" part is to split by <sup> and take the first value of the list
{% assign mf = product.metafields | where: "namespace", "foo" | where: "key", "bar" | first %}
{% assign new_mf = mf.value | split: "<sup>" | first %}
{{ new_mf }}
You can then use the list to output your string.
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024