Post Purchase donation custom amount

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”.
variantId number The product variant to add.
quantity number The quantity of the specified variant.
discount? ExplicitDiscount Refer to ExplicitDiscount.

Any ideas how to get round this? or am I missing something in the documentation?

Thanks,
Grant

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.

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 :slightly_smiling_face:

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

Did you end up building this app or use an existing app to enable the post-purchase donation? I am trying to add the same thing to my store. Thanks!

Thanks for this! That’s exactly the approach I ended up going for. Cart transforms would be a good idea but too limited for a public app

I did actually, the app is called CharityChoice. The only problem I’m finding with the post purchase extensions however is that Shopify has quite a few limitations on when the extension is displayed, relating mostly to payment methods. Happy to help you out though, you can get in touch through the app!

Thanks Grant, I’ve installed the app - it’s great. I’ve pinged you on the chat for help with the set up.