Calculatation and paypal

ellaroc

Member
Hello -

I need something similar to this post and I did check this link as well.

http://fabrikar.com/wiki/index.php/Element_Calculation

I have a registration form and the user selects a course and additional items to be added to the total.

This is what I have so far:

1. username

2. password

3. email

4. first and last name

5. phone

6. address

7. course location - I have set up a database join with Concat label and the 3 elements are combined into the paypal description (so that's good!):
{thistable}.course_date, ' ',{thistable}.city_region, ', ',{thistable}.country

8. course price - I can't figure out how to fill this in to match the cost of a particular course as they are all different (would I use another database join set to auto fill?)

9. Additional options - as a repeat field or table? (I would like to use a table unless a repeat is easier for now)
element: language certificate (checkbox or repeat of languages the user would like to include - they can select more than 1)
element: $20 (all the same cost for each language)

So this is what I need:

I need the list of languages to show with the the information in #7 above and then for the paypal total I need the course price and the language option to add up.

Course $100.00
Language 1 $20.00
Language 2 $20.00
Language 3 $20.00

Total only to show in the paypal plugin so hopefully I won't need any js = $160.00

I hope it's not confusing.

Thank you
 
Yes there is...

I have 3 tables:

Registrations (has general information including username and password)
Courses (fields - course date, course location, price, etc.)
Other options (description and price)

And, maybe I need an Orders table.

Thank you
 
For 8, one option is to make the price a CDD (cascading dropdown), which watches the course_location element, joins to the same table (using the course_location as the foreign key), and has "show 'please select'" set to No. So when you select the course_location, the course_price CDD menu should update, but with only one value (as it's using the course_location as the FK, and assuming course_location uses the courses table PK as the key ... etc etc). And with only one value, it'll auto-select that value. It's not pretty, but it does the job.

For 9, if you make the additional language options a table, create a join element to it, and set that to display as 'checkbox'. This will cause Fabrik to automagically create a many-to-many linkage table between the main table and your language_options table.

NOTE - using the 'checkbox' option for join elements is still a little bit "work in progress", and certain things just don't work with it (like 'search all'). But I think it'll serve the purpose you are describing the need for.

Your 'total' calc wouldn't be entirely trivial, and I'll have to do some testing to help you come up with the code ... I can't write it off the top of my head, as it's 7:30am, I haven't slept, and my brain is about fried. So bump this thread tomorrow, I'll see what I can do.

-- hugh
 
I can't get the cascade dd to work. I have the course location element as a database join and it is showing my concat elements all together. This is the element that I am joining to with my cascade dd but can't get it to cascade.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top