All things Shopify and commerce
Hey everyone,
I am deep in the weeds of trying to get my developer app working for our store to be able to rename a payment method using Shopify Functions but set it to the metafield value of the customer's company. We are a B2B store so all customers are assigned to a company. {{ customer.current_company.metafields.custom.cc_1.value }} is essentially the metafield I want to rename our first manual payment method to. Not looking for a step-by-step guide but just wanting to confirm it's even possible. I've seen other people accomplish displaying a customer metafield in a UI Extension but haven't seen evidence of a company metafield in a Shopify Function.
It’s currently not possible to directly access company metafields within Shopify Functions. Shopify Functions allow you to extend and customize Shopify's backend logic, but they have limitations on the data they can access, especially when it comes to customer and company-specific data.
However, you can achieve something similar by combining Shopify Functions with a Shopify App or a UI Extension that accesses the company metafield, and then use that data to dynamically rename the payment method in the checkout process.
In summary, while you can’t directly pull a company metafield into a Shopify Function, you could work around this limitation by using other parts of Shopify's API or custom apps to achieve the desired behavior.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024