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.
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.
Dive into the world of Print-on-Demand and discover how it can transform your online busin...By Imogen Feb 19, 2024
Discover how to transform your online store into a delightful shopping destination. Learn ...By Ollie Feb 13, 2024