Calculation in Backend Field

6 posts by 3 authors in: Forums > CMS Builder
Last Post: January 25, 2010   (RSS)

By InHouse - January 22, 2010

Suspect I know the answer to this one... but:

Is there any recommended method to insert an auto-calculate field in the CMSB backend?

i.e.: members of the site can place product orders using the backend. Would like to auto-calculate totals for products and costs either live or upon submission.

Failing to do this will force us to move the entire process to a front-end section of the site which we'd like to avoid in this case.

Many thanks,
Jayme

Re: [InHouse] Calculation in Backend Field

By Dave - January 22, 2010

Hi Jayme,

You could write a plugin to do it.

The basic code would look something like this:

if (@$_REQUEST['menu'] == 'product_orders') {
$_REQUEST['myField'] = "my new value";
}


Or you could hook into the save function if you wanted to do something more elegant.

Hope that helps! Let me know if that will work for you.
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Calculation in Backend Field

By InHouse - January 22, 2010

I think I see what you mean Dave. Thanks for the steer. I'll see what I can cobble together.

Still hoping for a CMSB shopping cart / e-comm toolkit. ;-)

J.

Re: [InHouse] Calculation in Backend Field

By gkornbluth - January 23, 2010 - edited: January 23, 2010

Hi Jaymie,

Hope you'll pass on what you put together with the rest of us.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Dave] Calculation in Backend Field

By InHouse - January 25, 2010

>Many people probably want non-login carts though.


Ironically, the current project would work better for my client with the profile-based cart, but I agree, most of the time the non-login would be desired.


If I manage to get this to work over the next couple of days I'll be sure to post the results. Might be forced to do everything in the front-end though as if one desired backend-feature can not be easily accomplished, then everything will have to be done elsewhere for the sake of consistency for the sure. <sigh>

J.