Hey Tolu. You can't do that, unless you do it through a discount or create a product on the fly which has the custom pricing (which is not scaleable). Another option would be to have all products duplicated, or at least variants duplicated (which again might not be scaleable) that will have different prices assigned. Then you substitute the right variant ID at the cart addition. But in this case you'll have to make sure only the variants with the relevant price are showing up on PDP.
And a bottom line, doing that only from the store front is not secure and definitely hackable.
I have created a product page that sends a request to my server when the user adds the item to the cart. The server creates a variant, returns it's variant ID to the product page, and adds that variant to the cart. The limitation of this approach is the 100 variant limit per product. Which doesn't scale.
I see their are apps on the app store that offer some form of dynamic pricing(Infinite options, Dynamic Product options, etc). I am curious what mechanism those apps are using to achieve this dynamic pricing behavior.
If you can dream up a nasty solution, then those are what those Apps do! As you can tell, making up variants on the fly is complete garbage as no accounting or inventory management can safely be applied, and if you think those "other Apps" are doing something smart and sensible and good with accounting and inventory management, well, you'd be wrong. You take them for a spin, and see what they do to your books. Infinite headaches!
Thanks for the reply. Thats disappointing to hear. Of all the approaches you've seen attempt dynamic pricing on Shopify, which is the best in your opinion? I am trying to figure out if there is a reasonable "hacky" solution or if I have to switch to platforms.
Luckily my store will have low sales volume, which should give me time to implement a proper solution on another platform if it starts to become a problem.
Thanks for your help,
I think you understand. A product has variants. variants have a price. You cannot change the price except by using a discount code, or in Plus, where you can script a checkout and change a price to whatever you want. Assuming you are not on Plus then, you get discount codes. That is all.
Ah ok. I wasn't aware of the Plus functionality. I will have to look into that a bit. I found a similar thread discussing the same issue. I will post it here for anyone reading this in the future.