Create an app that modify customer/cart

titeo
New Member
4 0 0

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.

0 Likes
HunkyBill
Shopify Expert
4509 46 492

This is NOT a use case for an App. You simply add some HTML and Javascript to the cart page. For example:

 

  • a numeric input for an amount
  • a listener for blur when an amount is added

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.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
titeo
New Member
4 0 0

Thanks for the reply.  I assume this solution is only works for a merchant right?  I need a capability that every merchant that install my app will see this text box in their cart.  It is still possible with the solution you suggest?

0 Likes
HunkyBill
Shopify Expert
4509 46 492

Yes of course. Your chores will be:

  • create enough HTML snippets so that most themes will look OK with your input fields, which of course will not match the theme itself
  • wire up the Javascript needed so it loads and works with most themes
  • provide instructions on the correct product to be created for the donations

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.

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
titeo
New Member
4 0 0

Thanks again.  I will do more research in the area.  I appreciate your professionalism and knowledge.

0 Likes
cypcz
New Member
8 0 0

Hello titeo,

were you able to make it work? What was your solution?

Thanks!

0 Likes