Personalized checkout and custom promotions with Shopify Scripts
Hello,
We are currently migrating from Shopify scripts to one-page checkout and are developing an extension that applies the product discount to certain customers based on the tag. What we want to do is,
if a product is on sale, i.e. variant has a compare-at-price value, then apply the discount to the compare-at price and if the compare-at price is null then apply the discount to the regular price.
Wondering if this is possible with product discount functions or any other functions. If so, how can we achieve this?
Greatly appreciate your time for reading and your input.
Thanks !!
I had the same problem as you. I'm currently developing the transition from script to function. We cannot access the compare at input in the product discount api. My client and I developed a solution by moving the compare at input to the metafield. We can also access the Metafield area through the product discount API. If there are not many products and variants, I recommend you move the compare at input to the metafield. If it is not possible to move manually, it makes more sense to move it by programming.
That is one way to do it if you have fewer products, unfortunately, we have lots of different products with variants and the sale is done by the marketing team through the Launchpad app, which does this compare-at-price thing when the sale is live hence I needed somehow the access to compare at price, however, this does not look possible with product discount API at this moment.
I thought this would be a simple use case but oh well, I spent a whole lot of time thinking the solutions from different angles. Anyways, thanks for replying and for the great suggestion.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey 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, 2024