Donate amount passed from form

2 years 9 months ago #325518 by bizguy
Donate amount passed from form was created by bizguy
Is it possible to use an amount entered on a form, chained to a CBSubs Donate subscription form, as the amount of the donation? I selected subscription type as donation, as there is no fixed amount of the payment.

The client wants to provide members with the ability to pay an invoice(s) through their payment processor online. In the form, I am collecting their invoice numbers, attached pdf invoice copies, and the total payment amount. I have this form leading to the CBSubs donation form for payment processing. I would like to avoid having them reenter the payment amount to avoid data entry errors. Is this possible?

Alternatively, is there a way to edit the donation form to include other fields (and I could eliminate the pre-form altogether)?

Thanks,
Ed

Please Log in to join the conversation.

2 years 9 months ago - 2 years 9 months ago #325521 by krileon
Replied by krileon on topic Donate amount passed from form
CBSubs isn't really designed to be used like that so no it doesn't have features to accommodate that easily.

You can use CB Auto Actions to insert a new field, but it has no storage behavior so you'd need to try and force that as well using CB Auto Actions. The below for example can render content before the donation input of a donation plan.

Global
Triggers: onCPayBeforeDrawPlan
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var1_id]
Operator: Equal To
Value: DONATION_PLAN_ID_HERE
Action
Method: HTML
Code:
CUSTOM_INPUT_HERE
Output
Display: return

You could then probably use onCPayBeforeStorePaymentBasketUpdated to store that inputs value into the baskets integration parameters. The entire process is complicated, may not work, and isn't really designed for this. In the future we may support custom fields for plans though.

There's also the following triggers that CBSubs Promotions uses to add the coupon field to the basket. Maybe it'd make more sense to develop a custom plugin that adds your custom inputs in the basket instead.

onCbSubsAfterPaymentBasket
onCPayEditBasketIntegration


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.168 seconds

Facebook Twitter LinkedIn