Gossamer Forum
Home : Products : DBMan : Customization :

Discount based on uid

Quote Reply
Discount based on uid
Very Sorry for posting a second time but I've gotten no responses to my first post titled "add % to # based on uid" and I'm under a deadline. Perhaps my situation was not explained clearly enough.

My client wished to have only 3 user ID and password sets. (well, 4 including admininsrator).

If user-1 loggs in, he gets no discount off the price stored in the database.

If user-2 loggs-in, he gets a 5% discount off the price stored in the database.

If user-3 loggs-in, he gets a 10% discount off the price stored in the database.

Any help would be greatly appreciated. Any response would be greatly appreciated, even one that tells me it's not possible.

Thanks again so much,
Peter

Quote Reply
Re: Discount based on uid In reply to
I'm really, really stumped. Please guys. I'm begging.

if rec{'$uid'} eq "admin"; { rec{'$Min_Price'} = rec{'Min_Price'} * "1.1"; }

I'm doing the best I can on my own and can't believe I've gotten no response yet. Am I close? If so, What else can I do to this code and where do I put it? (easy now! I know the answer is tempting)

I'll be forever grateful
Pete

Quote Reply
Re: Discount based on uid In reply to
OK, so it's 1:53 am and I'm still drinking coffee.
BUT I GOT IT!!!! So let me share it.

in: sub html_record {
under: my (%rec) = @_;
I added:

if ($db_userid eq "ten") {
$rec{'Min_Price'} = $rec{'Min_Price'} * "1.1" ;
}

if ($db_userid eq "fifteen") {
$rec{'Min_Price'} = $rec{'Min_Price'} * "1.15" ;
}

Works like a charm. Thanks anyway. This group is great.

Cheers,
Peter