Hi there! This is my first time posting so please be gentle!
I have a Shopify store that sells a limited number of products, but I am looking to expand. I want to build a Shopify app that automates the process of generating a specific string for each product variant that will be saved as a variant-level metafield.
I can figure out the coding myself - I would just appreciate some high-level guidance on what exactly I need to build. This is my first time building an app, so any ideas are appreciated.
Summary of project:
Each product variant in the store needs to have a âshipping messageâ metafield. This metafield is a string that will look something like this:
âProduct ships in 4-6 business daysâ
The exact syntax and date-range of each variantâs metafield will be determined by on the basis of a number of factors (product availability, product tags, certain other metafields). I have written the logic for generating this string - so I do not need any guidance on this front.
The aforementioned factors that determine the exact syntax and date-range of the string can change on a day-by-day basis. One of the metafields is updated regularly by a third-party app. A variantâs availability can change when the product is sold out. I change productâs tags fairly regularly too.
For this reason, I want to build an app that updates each variantâs âshipping messageâ metafield on a regular basis - perhaps every hour.
I have set up a basic embedded app using the Shopify CLI 3.0. Now Iâve done this, Iâm a bit lost. Here is what Iâm guessing I need to do:
-
Set up some kind of simple interface so that the appâs user can select a collection that contains all the storeâs products.
-
Once this collection has been selected, the ID of that collection will be used to retrieve a list of every product in that collection.
-
From there, each of each productsâ variant can be looped through.
-
Once at the variant-level, various information about that variant can be grabbed (product availability, product tags, certain other metafields).
-
With this information, I would (i) generated each variantâs shipping message using the pre-written logic, and (ii) replace its current âshipping_messageâ metafield with the newly generated shipping message.
[repeat steps 2-5 every hour]
If anybody could give me any pointers, suggestions ideas about which APIs I should use, how they should be implemented, and any best practices that I should follow, I would be really grateful.
Thanks for taking the time to read this!