Alright, here is what we do now:
-
Populate a product metafield promotion.offer with text to display on product page under the item title. This method works but is tedious since every product with that promotional offer needs to be manually entered into the metafields editor. And when the promotion is over, it needs to be deleted one by one for each product. It’s also a pain if we want to edit the promotional message for multiple products.
-
Hard code variables in product.liquid to look for a specific product tag, then display the promotional text. Changing the text is simple and the code can be commented out after expiring. But the tags still have to be deleted and the product.liquid page is junked up with extra code.
What I’d like to do:
Have a text file or liquid file with all of our current promotions and valid dates by product tag name. Products would still have to be tagged but once the end date is hit, the message will no longer be displayed. The file could look something like this:
←
promotionTag
promotionOffer
promotionStartDate
promotionEndDate
→
Save750
Save $750 on select products through April 30, 2023. Read more here, or Email us
2023-04-01
2023-04-30
FreeCase
Get a free case, or carrying strap, when you buy a camera.
2023-02-01
2023-06-30
A couple challenges.
-
We could have multiple promotions going on simultaneously, some current, some upcoming and some expired. I need to store multiple variables for each one based on the tag as the primary ID.
-
We use a lot of HTML and special characters in our promotion text. This makes using the split function a little tricky. The offer text is also usually long, which would make putting all the text in line hard to enter, read or edit.
-
The file needs to be human readable by a non-programmer.
I’ve searched and searched and no one seems to have tried this before, or asked about it. Any ideas?