I'm basically at my wits end here. The PriceRule API seems to be fairly useless for creating anything beyond very basic discounts, and the fact that I can't use multiple coupon codes during checkout or add multiple PriceRules to a single Discount code makes a very simple task incredibly frustrating.
But </vent>, I need to be able to give a select group of customers both a free product and free shipping on that product, while also providing the ability for them to add additional quantities of that same product to their cart, so they can either checkout for free (if they had no additional items added), or check out with an appropriate discount.
I exhausted all the options using PriceRule and `entitled_variant_ids` and basically decided the easiest solution would be to simply give these customers a flat discount that is equivalent to the price of the item and shipping. But now I've discovered that discounts cannot apply to both the subtotal and the shipping!
Let's say the product is $50 and has a flat shipping fee of $10. I finally landed on generating a coupon for $60 with no variant limitations. This works fine if the customer has added additional items to their cart, because generally that second item bumps their subtotal over $60 and the discount is fully applied. But if they don't, if they just have the 1 "free" item in their cart, then the subtotal is discounted by only $50, the shipping cost of $10 is added, and the total order is $10. It should be $0, for a 'free' checkout.
So is there any way to apply the discount across the entire order, not just the subtotal, or can anyone think of a way to workaround these limitations and provide customers with a 'totally free' product that has no shipping cost applied? (While still charging shipping to customers who do not have the discount code?)
Edit: I should also note, this is something I need to do between a Private App and a custom theme. The solution does not need to work for a Public app or universally work with any store.