Can you save data in custom attributes on a storefront?

Khasim
New Member
4 0 0

Hi Everyone,

 

I would like to know if there is an option to store data in custom attributes. For example, in the storefront, we enter some value in a custom attribute and then try to store it when an event is performed. Will this action store the value in the Shopify admin?

Replies 2 (2)

PageFly-Theodor
Shopify Partner
595 77 91

Hi @Khasim ,
This is Theodore from PageFly - Shopify Page Builder App.

While Shopify doesn't directly store data from custom storefront attributes, you can achieve a similar effect through a combined approach:

  1. Metafields: Utilize these custom fields to store additional information associated with products, orders, or other resources.

  2. Event-Triggered Actions: Capture user input or specific events (form submissions, button clicks) using JavaScript in the storefront.

  3. Server-Side Script: Employ a server-side script (ideally within a Shopify app) to interact with the Shopify Admin API. This script:

    • Creates new metafields.
    • Sets their values to the captured data.
    • Associates them with the relevant resource (e.g., the product).

Best regards,
Theodore | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.

Khasim
New Member
4 0 0

Hi @PageFly-Theodor 

 

Could you please share any document you are aware of which I can go through for this. I already created  metafield (input field) and wanted to store the value entered by users in the customer object metafield when they type in there and hit submit. Any help is highly appreciated.

 

Thanks

Khasim