If you wish to change the suggested donation amounts of your Tamaro widget, the following code snippets can serve as a template.
Change one time donation amounts
You can set the default amounts for a one time donation via this code snippet:
<script>
window.rnw.tamaro.runWidget('.rnw-widget-container', {
amounts: [
{
"if": "paymentType() == onetime",
"then": [20,50,100,200],
},
],
});
</script>
The field for a custom amount will appear automatically. You can choose the number of amounts you would like to predetermine yourself. We recommend using 3 to 4.
Change recurring donation amounts
You can additionally adjust the amounts for each recurring interval separately. In this case you can add to the "amounts" part in the following way:
<script>
window.rnw.tamaro.runWidget('.rnw-widget-container', {
amounts: [
{
"if": "paymentType() == onetime",
"then": [20,50,100,200],
},
{
"if": "paymentType() == recurring && recurringInterval() == monthly",
"then": [10,20,50,100],
},
{
"if": "paymentType() == recurring && recurringInterval() == quarterly",
"then": [15,30,50,100],
},
{
"if": "paymentType() == recurring && recurringInterval() == semestral",
"then": [15,20,80,100],
},
{
"if": "paymentType() == recurring && recurringInterval() == yearly",
"then": [40,75,130,200,300],
},
],
});
</script>
The same applies to recurring donation amounts: you can choose the number of amounts that you predefine and the field for custom amount will be there by default.
If you want to determine the amounts in condition to the currency that is selected, you will find a code example in this article.
Comments
3 comments
the link to the condition to the currency (very bottom) leads to setting the language
Thank you, Sigrid, for letting us know. We have now linked to the correct article in our knowledge base!
Is there a way to pre-fill the custom amount?
Please sign in to leave a comment.