I am working on converting a Script into a Discount Function before I upgrade to checkout extensibility.
I have created the discount app and it seems to be working fine, but the last piece is to prevent the automatic discount from being applied to product variants that have a compare at price higher than the price.
Using the old Shopify Scripts, we were able to access .compare_at_price, but I am not seeing anything similar in GraphQL ProductVariant object…
While discount functions can be used to apply discounts based on certain conditions, they don’t have access to the “compare at price” in the same way that scripts did previously. You’l need to explore alternative methods for applying discounts, possibly by using the available pricing data that is accessible through the new extensibility features.