App based validations and access to cart.metafields #381
Replies: 6 comments 3 replies
-
Hi @elvonkh -- Thanks for the feature request. Support for cart metafields is planned, but keep in mind that they don't have a significant security benefit. They can be set from the client, so they could be manipulated from the browser console or a browser extension. Data from the client should always be validated. If your application business logic can't be replicated in the function itself, you should sign the values you store on the cart from the server-side of your application, then validate the signature in the function. |
Beta Was this translation helpful? Give feedback.
-
we also wanted to query cart metafields on input query. |
Beta Was this translation helpful? Give feedback.
-
Reopening as cart metafields are still an open feature request. |
Beta Was this translation helpful? Give feedback.
-
I have checkout-UI-Extension where the user can define that the order is a business order, with some additional fields we attach if so. Now I wanted to put a validation function where I would check, if it is a business order (the metafield) and place a validation error on the users company field ( I struggled getting this done, and found this discussion here. Thanks a lot! |
Beta Was this translation helpful? Give feedback.
-
Bump for cart.metafields |
Beta Was this translation helpful? Give feedback.
-
@nickwesselman Hi Nick ! any news regarding cart.metafields ? |
Beta Was this translation helpful? Give feedback.
-
We require validation for the shopping cart and checkout to ensure that access to
cart.metafields
is controlled viaInput
. At present, Storefront users have the ability to easily modify line item properties, which serve as crucial keys in various applications, particularly when it comes to applying discounts or utilizing app features. To enhance security and prevent potential vulnerabilities, it's imperative to introduce a property that can only be manipulated by the app itself, much like the use of metafields for the cart.Within
cart.metafields
applications can securely store data that's essential for conducting cart and checkout validation. This safeguards the integrity of the data, as Storefront users won't have the ability to make unauthorized changes to it.Beta Was this translation helpful? Give feedback.
All reactions