I’m working on a solution to manage voluntary donations in my Shopify store, and I have a specific requirement:
I would like to modify the cart total without adding a physical or virtual product to the cart. The idea is to allow customers to make a donation, but without creating a specific product (like a variant or an item in the cart).
I’m wondering if there’s a way to directly modify the cart total through the API or any advanced Shopify settings, without necessarily adding a product.
Has anyone encountered a similar situation or has any suggestions on how to proceed?
I’m not sure it can be done without putting something in the cart. Is the use case that you want to allow people to enter a donation amount and don’t want to have to deal with tons of variants representing different donation amounts?
You might be able to have just a single “Donation” product with a base amount of 0. When a donation is made, if that product is not already in the cart, then add it, otherwise update a cart attribute that contains the donation amount. Then use the cart-transform api (update) to read the cart attribute and change the price of the donation product to match.