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 Dave - January 22, 2010

>Still hoping for a CMSB shopping cart / e-comm toolkit

Me too! Can't wait to replace the paypal we're using in the add-ons store.

We just released a couple new plugins with more membership functions. We have a geolocating one in development next, maybe sometime after that.

I'd like it to be able to tied to the current users account so it stores their cart items in their profile like amazon does. Many people probably want non-login carts though.
Dave Edis - Senior Developer
interactivetools.com

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.