Best way to define custom global metafields for my client shop

Best way to define custom global metafields for my client shop

fclerc
Shopify Partner
2 0 0

Hi all,

I'm a shopify developer, currently developing a theme for my client.

I have no problem to define custom metaobjects and metafields attached to products, collections or objects like that, but what is the best way to define metafields that will be used as global settings for the entire shop ? And i need these settings to be accessible for my client to modify.

 

I'm thinking of settings like "default image for something", "default text for shipping policy", "default image to display on the right on the mega menu", etc... In fact, these kind of settings could appear in the "brand" page, but i don't think i can add custom metafields to this page, right ?

 

I tried to add metafields to the SHOP object (via a custom app and GraphQL) and it works, but there is no way to modify these settings via the admin ! The SHOP object is not available in the custom metadata section...

Also, i don't want it to be "theme settings", because i don't want my client to have to go in the "theme" part of the admin.

 

Any help or idea will be welcomed.

Thanks

Replies 3 (3)

pawankumar
Shopify Partner
754 111 128

Hi @fclerc 
Metaobject is best suited for your case
Thanks!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan
fclerc
Shopify Partner
2 0 0

Hi,

Thank you for your answer.

But what do you mean exactly ? I understand the use of metaobjects, but how can it help me define an object accessible globally in liquid to store shop settings and that can be modified by my client ?

Thanks

pawankumar
Shopify Partner
754 111 128

You can access in liquid like this: https://shopify.dev/docs/api/liquid/objects/metaobject
You just need to explore some of these basic terms and then it will be very handy to use

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan