Post Purchase donation custom amount

Post Purchase donation custom amount

grantmalone
Shopify Partner
1 0 0

Hi, 

 

I'm building a donation app which allows the customer to choose from three donation options on a post-checkout extension. I am using product variants for each of these donation options, prices set from the admin dashboard. 

 

I would like to add a 'custom amount' field, as I have seen other post-purchase apps doing. However I am unsure how to achieve this. From the docs it seems like I can only add a product variant, but can't change the price of this variant.

AddVariantChange

Requests a variant to be added to the initial purchase.

Name Type Description
type"add_variant"A fixed value of "add_variant".
variantIdnumberThe product variant to add.
quantitynumberThe quantity of the specified variant.
discount?ExplicitDiscountRefer to ExplicitDiscount.

Any ideas how to get round this? or am I missing something in the documentation?
 
Thanks,
Grant
Reply 1 (1)

Abel_Lesle
Shopify Partner
354 7 23

Ah we actually checked this out a while back @grantmalone , what they basically do is create three variants in the common currency denominations.

 

When the customer enters a custom value like 1.5$ or something like that, they then break it down into the relevant variants and quantities and then add it to cart.

 

This is the most common approach that we've seen. The other approach that would work here is to use a cart transform and update the price (but this is supported only for Shopify plus) - the advantage here is that it would look cleaner and nicer on the user's cart.

Abel_Lesle_0-1748376225837.png

Abel_Lesle_1-1748376235564.png

 

It was a while back so I don't really remember which app this was, but the product still seems to be on the store 🙂

 

Hope you come across something better than our limited knowledge here.

Founder
Dollarlabs: Ultimate Discounts (5★) – If you can think of a discount, you can build it
Dollarback: Cashback & Loyalty (5★) – Simple cashback. Powerful loyalty.