Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Can the changing of a metafield's available list of values be used to cause either
- the metaobject that field is part of, or
- another separate metaobject completely,
to 'choose' (auto-populate) the metaobject field values in order to remove the requirement for someone managing a product page from having to pick each metaobject item's field value manually?
Scenario: Theme is Stiletto -- This is wallet business offering ready-made items as well as made-to-order and custom-order options (made-to-measure is a clone of the wallet showing. Custom allows customer to pick each element of the design. Not important here but for context.) There are about 20 different patterns possible.
When an item is made the new product's "AVAILABILITY statement" metafield would be set to "In Stock". This causes that string to be displayed in a dynamic field on the web page under the title. Since there is only ever one item in each material, everything starts out as having a Qty of 1 and in stock.
When the item is sold out it becomes a Made to Order item, requiring the setting of a new quantity based on the product possible from the material remaining, and that same metafield is now switched from In Stock to sat Made to Order on the product page.
But ... in addition to this and to support other aspects of the shop and the information shown to customers, there are other metafields (and a tag!) that need completing based upon what the AVAILABILITY statement might be ...
1 - a Boolean ("AVAILABILITY as DYO") 'design your own' field (TRUE only if a template for that item has been created -- an element that is in process to be revealed and when implemented will provide link to template page for design your own. An item can be in stock or made to order AND offer a design your own template). Until this idea is implemented it is always set false.
2 - a Boolean ("AVAILABILITY as MTO") made to order' field (TRUE if the in-stock item is sold out but still has material sufficient to make more on per-request basis. Used in custom liquid to show a product badge.)
3 - a pick list text field ("PRODUCTION TIME") to change the production time string from 'in stock' to one of several versions of "x to y days to make before shipping" strings --- (BONUS BELOW ***)
4 -a pick list text field ("addl order info (optional) ") to change or clear additional order statements, such as "pattern placement will vary from photo in made to order items"
5 - (a throwback to pre-2.0) set/clear a tag that says either IN STOCK or MADE TO ORDER for display overtop the product thumbnails and above the title on the product pages
So in all six things toggle states or strings based on whether In Stock or Made to Order is chosen.
What my ideal world envisions is something that allows my sister to still choose either "in stock" or "made to order", and a metaobject on the product page or some other voodoo magic pick the appropriate values for each of the five other fields that need to be changed when the production availability changes.
Is this at all doable?
(***) BONUS: The production time for a made to order item is always the same for every item. Having this field was initially implemented with the goal of providing a mechanism by which the shop owner could tell customers of a potential delay (e.g., around Christmas when the production can extend well past a normal 2-4 days). I conceived this as being a global option - set once somewhere and all pages displaying that metafield would show the same global string.
I've read of shop-level metafields that are available across the site but have been unable to find how to configure one, or even find an alternate suggestion to achieve this same goal. [I want (need?) to keep meddling fingers out of the Customize area because they're not comfortable messing about with the unknown.]
Solved! Go to the solution
This is an accepted solution.
Metaobjects(MOBS) are not a cure all always have a goal why they must be used instead of other simpler systems https://xyproblem.info/ .
Try to narrow the scope of the question your describing an entire convoluted process where you've self prescribed MOBS as a solution.
Aim for minimized repeatable experiences in seeking free help.
Use browser features, or browser extensions to add text to form inputs with autofill
If the shopify admin acts incompatible with such things report it to shopify support as a bug or feature request impacting productivity in an online world.
Autofill via "shopify magic",
shopify's been putting generative text features in different areas of the admin UI if this could be useful for MOB workflows make a feature request.
@birchr wrote:What my ideal world envisions is something that allows my sister to still choose either "in stock" or "made to order",
Doable, sure , yet nothing described indicates MOBS are even needed.
Simplify , use tags and shopify flow to set either tags or metafields.
From what I understand of the described process MOB entries only make sense if the are being applied for order line items to have granular information.
Otherwise on products there just needs to be a simple dropdown of preset status types to select that have set values that apply to every product that get that status type.
Though in a round about way describing a new type of non-theme template/boilerplate/standard-definition system that just goes onto of how MOBS already work as templates.
@birchr wrote:
five other fields that need to be changed when the production availability changes
Doesn't seem like anything needs to change, there's preset choices that lead to a small set of unchanging predetermined outcomes requiring no human interaction.
This is the type of thing to just hardcode business logic into metafield definitions , themes, or notifications, until after more advanced systems are understood and worked out.
If the goal of this is for the messaging for customers in an online-store theme or notifications based on a small set of repeating rules then that indicates theme customizations applying business logic should be put in place instead of admin work that doesn't even have to be done and MOBS are likely overkill.
Metaobjects(MOBS) are not a cure all always have a goal why they must be used instead of other simpler systems such as tags or metafield-definitions on a resource(products,orders,etc). See https://xyproblem.info
As a guideline MOBS are probably better suited to predetermined content with a high number permutations of static info
i.e. entries , author/staff/employee bios, ingredient lists, selling locations, maker profiles, product personalization presets, product reviews with links&images&other , etc.
Or from the other end static resources(products,collections,etc) needing a high amount of changing info among sets of those resources; i.e. laundry instructions.
For example to minimize repeated data entry for the same info shared among sets of resources(products,collections,etc) minimizing setup of metafield values.
i.e. as preset configurations(static) ; discount messages, related articles, etc; like a theme template applied to a product
On the flipside they can be good for very granular per object info , such as an order getting specific notes/picture for specific steps in fulfillment that don't make sense to go on the order timeline or in order notes or on the general product data, etc
I.e. auditing/logging.
Auto generating MOB entry values is not a native behavior of metaobjects(MOBS).
And I would never expect it especially also then interacting with inventory.
Though shopify-flow getting built in tasks or actions isn't unlikely but they probably need merchants to contribute use-cases that are generally applicable to most merchants and not specialized processes https://community.shopify.com/c/shopify-flow-app/bd-p/flow .
But that's the type of things meant for api's and app , ala custom-apps for custom solutions.
See either shopify-flow and it's advanced admin actions to interact with the api.
Or roll custom automation scripts using mechanic, there's no premades for MOBs but plenty of behavior examples for a variety of surfaces including mf's:
@birchr wrote:I've read of shop-level metafields that are
shop level metafields(mfs) currently need an app to interface with sanely, there are not metafield definitions UI for shop mf's.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
This is an accepted solution.
Metaobjects(MOBS) are not a cure all always have a goal why they must be used instead of other simpler systems https://xyproblem.info/ .
Try to narrow the scope of the question your describing an entire convoluted process where you've self prescribed MOBS as a solution.
Aim for minimized repeatable experiences in seeking free help.
Use browser features, or browser extensions to add text to form inputs with autofill
If the shopify admin acts incompatible with such things report it to shopify support as a bug or feature request impacting productivity in an online world.
Autofill via "shopify magic",
shopify's been putting generative text features in different areas of the admin UI if this could be useful for MOB workflows make a feature request.
@birchr wrote:What my ideal world envisions is something that allows my sister to still choose either "in stock" or "made to order",
Doable, sure , yet nothing described indicates MOBS are even needed.
Simplify , use tags and shopify flow to set either tags or metafields.
From what I understand of the described process MOB entries only make sense if the are being applied for order line items to have granular information.
Otherwise on products there just needs to be a simple dropdown of preset status types to select that have set values that apply to every product that get that status type.
Though in a round about way describing a new type of non-theme template/boilerplate/standard-definition system that just goes onto of how MOBS already work as templates.
@birchr wrote:
five other fields that need to be changed when the production availability changes
Doesn't seem like anything needs to change, there's preset choices that lead to a small set of unchanging predetermined outcomes requiring no human interaction.
This is the type of thing to just hardcode business logic into metafield definitions , themes, or notifications, until after more advanced systems are understood and worked out.
If the goal of this is for the messaging for customers in an online-store theme or notifications based on a small set of repeating rules then that indicates theme customizations applying business logic should be put in place instead of admin work that doesn't even have to be done and MOBS are likely overkill.
Metaobjects(MOBS) are not a cure all always have a goal why they must be used instead of other simpler systems such as tags or metafield-definitions on a resource(products,orders,etc). See https://xyproblem.info
As a guideline MOBS are probably better suited to predetermined content with a high number permutations of static info
i.e. entries , author/staff/employee bios, ingredient lists, selling locations, maker profiles, product personalization presets, product reviews with links&images&other , etc.
Or from the other end static resources(products,collections,etc) needing a high amount of changing info among sets of those resources; i.e. laundry instructions.
For example to minimize repeated data entry for the same info shared among sets of resources(products,collections,etc) minimizing setup of metafield values.
i.e. as preset configurations(static) ; discount messages, related articles, etc; like a theme template applied to a product
On the flipside they can be good for very granular per object info , such as an order getting specific notes/picture for specific steps in fulfillment that don't make sense to go on the order timeline or in order notes or on the general product data, etc
I.e. auditing/logging.
Auto generating MOB entry values is not a native behavior of metaobjects(MOBS).
And I would never expect it especially also then interacting with inventory.
Though shopify-flow getting built in tasks or actions isn't unlikely but they probably need merchants to contribute use-cases that are generally applicable to most merchants and not specialized processes https://community.shopify.com/c/shopify-flow-app/bd-p/flow .
But that's the type of things meant for api's and app , ala custom-apps for custom solutions.
See either shopify-flow and it's advanced admin actions to interact with the api.
Or roll custom automation scripts using mechanic, there's no premades for MOBs but plenty of behavior examples for a variety of surfaces including mf's:
@birchr wrote:I've read of shop-level metafields that are
shop level metafields(mfs) currently need an app to interface with sanely, there are not metafield definitions UI for shop mf's.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hi Paul ... thanks for the detailed reply. I guess in the simplest xyproblem-avoiding parlance, I wanted 5 things to change on a product page based on the value of one metafield. Now whether that involved other metafields, metaobjects or any other mechanism, I don't know.
I suppose I was trying to prevent having create a different product template for products once moving into the 'made to order' category, but after reading your response that might just be the simplest way to get the results I want. So instead of metafields to set the data and custom liquid code to display the correct sub-strings and icons based on the state (available or not), I can make different pages just for in-stock and made-to-order with the respective strings hard-coded.
Still might be fun to try and force Flow to do things like this, although I did take a look at that to see if it can set the value of a metafield and in my cursory look, it appeared that was a no.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024