Copied to clipboard

Flag this post as spam?

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


  • Alex 3 posts 73 karma points
    1 week ago
    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 2814 posts 14379 karma points MVP 7x c-trib
    1 week ago
    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 3 posts 73 karma points
    7 days ago
    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 2814 posts 14379 karma points MVP 7x c-trib
    6 days ago
    Matt Brailsford
    0

    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