App reviews, troubleshooting, and recommendations
Hi everyone,
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?
Thanks in advance for your help! 🙏
Hi @gigimurgia
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.
https://shopify.dev/docs/api/functions/reference/cart-transform#example-update-operation
-- Adam
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024