Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-04 11:47:59

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

calculating a price based on form input with zem_contact / mem_form?

For a conference registration I’d like to realise a very simple payment option using paypal.
The amount needs to be calculated and passed to paypal based on two simple form inputs:

a) day 1 only, day 2 only, both days
b) non-member, member, student

I presume this will need an additional function that hooks into the form events. How could I use the mem_form/zem_contact_reborn api to retrieve these values and calculate the resulting cost in a (hidden) item for passing to paypal (with code example if possible)?

I’m aware I could do this without mem_form/zcr but I’d like to use their excellent error-handling facilities (plus the form is already built with zcr).

All suggestions welcome!


TXP Builders – finely-crafted code, design and txp

Offline

#2 2008-10-04 17:15:03

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: calculating a price based on form input with zem_contact / mem_form?

jakob, have you seen yab_shop? it is a quite complete paypal/shopping cart plugin, and the latest versions let you have different prices based on parameters


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#3 2008-10-04 23:08:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,729
Website

Re: calculating a price based on form input with zem_contact / mem_form?

kemie, yes I have seen it (tho’ not tried it out) but from looking at the site, it looks like overkill in this particular case. This case is very simple, there’s no need for a cart just the choices stated above plus contact details and similar. There are essentially nine options and as both single-days cost the same, only six price variants.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB