[ic] One-time *AND* recurring charge totals?

William W. Ferrell interchange-users@interchange.redhat.com
Fri May 31 00:08:01 2002


Greetings, everyone.

I'm trying to set up a seemingly straightforward shop for my employer (a
web hosting company) but I'm having a bit of trouble.

We'd like to be able to offer "base packages" then allow customizations.
This part's easy -- the product options facility handles this. The
trouble comes in because the goal is to present *two* totals to the
customer. One is the "setup fee" that they'll pay up-front to get the
account set up and running, and the other is the monthly recurring fee
they'll pay monthly to keep the account current.

I don't care one bit if Interchange does the recurring billing part :)
I'd just like it to *show* the buying customer both the "due now" total
and the "what you'll pay every month" total.

So far, I've gotten this to work for the product objects themselves --
it's just another column in the database. The challenge comes in dealing
with the options; Interchange works its magic on the initial cost of an
option just fine (if an option means an additional setup fee, this gets
added to the product's total "due now" cost just as expected). It's the
monthly fee that also needs to be assigned to the option that I'm having
trouble with.

I'm using the Foundation store for my testing in all this, by the way.

To add in the monthly fee for the products themselves, I just added a
new field into the database (I'm using MySQL for the back-end for this
deployment, so that was easy) and added [item-field monthly] to the cart
component. Works like a champ.

Now how might I get the cart component to *also* tally up the monthly
costs of the options (if any) when it's showing the monthly fee?
Obviously I'll need to replace that simple [item-field monthly] with
something a bit more convoluted, but I'm not sure where to focus my
black magic next :)

Also, I haven't yet figured out a way to get the total for monthly fees
down at the "totals" bar in the cart component. So I guess I'm asking
how to generate something like this (these numbers are completely 
random, BTW :):

Item: Basic Hosting  $4.95 setup, $12.95/mo
   Extra Disk: [ +20GB $1.95 setup, $1.95/mo ]

   This Item's Setup Fee: $6.90
   This Item's Monthly Fee: $14.90

(pretend there's other items similar to this in the cart, too :)

Total Setup Fee: $12.85
Total Monthly Fee: $43.85

Any ideas how I might tackle this challenge? I apologize if I've asked a
stupid newbie question -- I welcome thwacks from the cluestick.

I appreciate any help you can offer.