Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Is it possible to add a custom customer metafield value to the order using Flow? Is there another way to achieve this?
Our CRM has to communicate with Shopify using existing customer identifiers.
Thank you in advance.
Solved! Go to the solution
This is an accepted solution.
@PinkProBeauty, to add a value to the order metafield you would want to use the following liquid code, making sure to use the appropriate namespace and key corresponding to your customer metafield.
{%- for metafields_item in customer.metafields -%}
{%- if metafields_item.namespace == "NAMESPACE"
and metafields_item.key == "KEY" -%}
{{metafields_item.value}}
{%- endif -%}
{%- endfor -%}
Also make sure to use an appropriate metafield type for the data you are trying to add.
Here's an example screenshot: https://share.heliumdev.com/7KuW9YA4
It's possible to check a customer metafield value when an order is placed, yes. Where would you need to insert the value?
Thank you for replying Paul!
I need the value of the custom customer metafield to be inserted on the order itself.
Basically I need my CRM to recognize the Shopify order came from that specific customer that has a pre assigned customer number by the CRM. We uploaded all of those customer numbers as custom metafields to the customer profilles, I just need whenever an order is created for that customer metafield to attach to the order so whenever it is exported, it will be visible on the spreadsheet to use as the common identifier.
So I don't know what fields your CRM imports. Also, you may run into an issue where the CRM imports the order before the order is updated. Currently, the three places you can add additional info to an order, via Flow, are the order note, order tags, or order metafields.
We have to manually set the schedule for imports. I found the update order metafields, but I can't seem to get it to add the customer metafield. Could you assist further with this? I really appreciate your assistance.
This is an accepted solution.
@PinkProBeauty, to add a value to the order metafield you would want to use the following liquid code, making sure to use the appropriate namespace and key corresponding to your customer metafield.
{%- for metafields_item in customer.metafields -%}
{%- if metafields_item.namespace == "NAMESPACE"
and metafields_item.key == "KEY" -%}
{{metafields_item.value}}
{%- endif -%}
{%- endfor -%}
Also make sure to use an appropriate metafield type for the data you are trying to add.
Here's an example screenshot: https://share.heliumdev.com/7KuW9YA4
This worked like MAGIC!
Thank you so much. We're also Helium customers as well 🙂
Using Liquid in Shopify Flow can definitely be a bit tricky, but I'm glad to hear that worked for you!
And thanks for using our apps, we're always glad to hear that 😁
You can use the below code to implement the same
{% if customer.metafields.register.company != blank %}
<input type="text" name="attributes[crm_attribute]" form="cart" value="{{customer.metafields.register.company}}" />
{% endif %}
customer.metafields.register.company is metafield name replace it with your value.
Hope this will help...
This is asked for Shopify Flow. I think your solution here is to customize the checkout liquid.
no this is a cart page modification.
Please refer the below article for more details
https://shopify.dev/docs/themes/architecture/templates/cart
Thank you! I will have IT try this method momentarily.
Where exactly do I need to put this code? It's giving me an error when I add it to the cart.json
main-cart-footer.liquid
User | RANK |
---|---|
3 | |
2 | |
2 | |
2 | |
1 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023