I don't know if this question has been asked. Please excuse me if it is. I want to create a donation app that insert a text box into customer cart. If the user add an amount to the text box, the total price will change depend on how much that input. I don't know where to start for modifying the cart. Please point me in the right direction.
In the listener you'd take that value and add that many units of some donation product in the shop inventory to account for the amount.
Simple is good. Complex is bad. Simple means merchants adds one product to their inventory with a unit donation amount. Say $1 for 1 unit. That way, if a customer wants to donate $10, you can add 10 units of the $1 product to the cart... when the amount field is filled in...
If you really wanted an App for that, have fun.. you're going to work for many hours on mickey mouse fiddling... to achieve what you could achieve quickly with just some copy and paste.
Yes of course. Your chores will be:
All in all, if you can pull all that off, you might get some takers... it's an old pattern for sure, nothing ground-breaking there. I am sure others have developed better patterns by now. The donation box thing came up when Shopify first opened in 2006 so examples in the wild probably abound. Find a few and then copy their patterns I guess till you find one you can live with.