Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Alex 7 posts 87 karma points
    Oct 14, 2020 @ 22:36
    Alex
    0

    How to go about donations?

    Hello,

    Is it possible to set up donations in Vendr?

    Basically have a user click the donate button, have them type in their amount and run them through the checkout with the amount they typed in?

    Thanks!

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 15, 2020 @ 08:09
    Matt Brailsford
    0

    Hey Alex,

    You should be able to do this by implementing a custom IOrderLineCalculator

    What you'd probably need to do is create a "Donation" product, then when it is added to the order record on the order line as an order line property (https://vendr.net/docs/core/1-3-0/key-concepts/properties/) the amount the customer wishes to donate, then in your order line calculators CalculateOrderLineUnitPrice return this price as the order line unit price.

    Hope this helps

    Matt

  • Alex 7 posts 87 karma points
    Oct 15, 2020 @ 22:21
    Alex
    0

    Thanks for your answer Matt.

    I've created the Donation product, but i have to set a price on it when I set up the product in the shop as it is a required field.

    Where and how would I override that price say, if I wanted the customer to enter an amount and click the 'donate' button?

  • Matt Brailsford 4124 posts 22215 karma points MVP 9x c-trib
    Oct 16, 2020 @ 06:41
    Matt Brailsford
    100

    Hey Alex

    Give your product any price as you’ll override it in the order line calculator. You’ll then need to render an input field on the product page for your discount for the customer to enter their donation amount. You’ll need to capture this and pass it in as a custom property when you add the product to the order. Then in your order line calculator you can read that property from the order line and return that as the unit price.

    Hope this helps

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft