Branching on Paypal form - $0 amount = do not paypal, do submit to db - How to do?

bggann

Active Member
I have a form where people can order a variety of items (meal reservations) and pay using paypal. However, one item is a free one and people can reserve that free item with no others - resulting in a $0 paypal amount. Paypal rejects this - and not gracefully.

I need some way to either:
1) warn them that they must use an alternate form to order JUST the free item.
or
2) Process the record into the database and email, but not kick the Paypal submission off.

I've tried a variety of methods.
- Put a validation on the 'calculation' field where the total is - require that the total > 0. The error would say 'Use this other form instead'. Validation does not run.
- A variety of re-directs, etc.
- I've looked that the ipn paypal.php function - seems like that is run POST paypal - but perhaps I can use it to stop the paypal - if I do, will it continue the database and email submission (I could send an email from the .php function.)

I've not figured out anything that would work.
The best option would be to somehow intercept the paypal function so that it does not submit a $0 amount, but continues the form submission.
Alternative options that are "okay"
- Pop up a warning WITH a link to another form - then prepopulate that form with the information they have already entered.
- Place a button on the form that says "I'm just reserving the <free> item" and let them hit this - and populate the form with data.
- I tried embedding a java script in the PHP submission function - BAD IDEA - broke the form/broke Fabrik, had to rebuild.
- I did an "echo" in php, but it is seriously ugly - just a message in a blank window.
- Other ideas?

Right now - I've split this into 2 forms. They order the 'cost' items on one, then have to go to the other to order the free items. They both record to the same database table, 2 fabrik tables. It works, but is combersom for the users - they have to fill out 2 forms.

Running Fabrik 2 (latest) on Joomla 1.5 (latest)

Ideas?
 
In the paypal form plugin there's a condition field.
Put PHP code returning false if costs are 0
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top