[Pro] Calculating Order Form

I need to have a method on a customers site to have an Order Form that will give a total of all items that have been selected.

They just need to have the order details and the customer see the total amount via something like a php from action.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There are a couple of ways to tackle this. One is the “live-updating total”, which is coded in JavaScript and runs in the browser (and thus is inherently untrustworthy). The other is to run the calculation on the server, and to only accept the quantity and the item number(s) from the browser, and look up the price on the server. (Again, because anything the browser sends you is completely not to be trusted. The visitor could – trivially easily – change the price from £5 to £0.05 before submitting the form.)

First, you may want to look at the Freeway Shop Actions (a cut-down version of Tim Plumb’s Mals E-commerce Action suite) or Tim’s original Actions. Even if you don’t use the Mals system for the payment process, you could use the cart to gather items and send you the details. Mals includes a system whereby you calculate a checksum for each product, so you can tell if anyone has tampered with the price per item.

Next, if you want to do the courtesy live-updating total, you can code that in JavaScript. I’ve posted numerous examples here, just search the list for the word ‘calculator’ for a bunch of examples. Here’s one that’s pretty relevant:

http://www.freewaytalk.net/thread/view/117033#m_117036

If you want to do this on the server side, you can’t use the PHP Feedback Form or the Send Form Action without modifying either. Both are pretty “hackable” if you have a basic grasp of PHP coding, but you would need to use the Action to generate the form handler, then modify the generated handler, and then finally remove the Action from the page (so it doesn’t overwrite your code changes at the next publish) and make the changes in the Form Setup dialog to point to your modified handler.

Walter

On Jul 1, 2013, at 4:22 AM, t50ufo wrote:

I need to have a method on a customers site to have an Order Form that will give a total of all items that have been selected.

They just need to have the order details and the customer see the total amount via something like a php from action.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter

Thankyou for your reply.

I had not considered Mals and The Action Suite with payment disabled. This sounds like a good option as I use Mals and know it quite well.

I will just have to have a look at the process of non payment and if that is quite easy - this would suit my purpose well

Trev


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options