[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Controlling Spending
****** message to minivend-users from "Mr. Anthony R.J. Ball" <ant@maine.com> ******
> Here's an interesting puzzler:
>
> A client wants a B2B-type store, where after typing in their Dunn and
> Bradstreet number, the shopper is approved for a certain amount of credit,
> and is not allowed to spend over their credit limit.
>
> I'm working on the Dunn and Bradstreet part now, does anyone have any ideas
> of how to limit expenditure when someone is shopping?
I know I could do it with perl, just check the basket total, the credit,
and just pop items off the basket till it's under. Not sure how to do it
in vanilla minivend.
sub no_more {
my ($credit) = @_;
while(&Vend::Interpolate::tag_total_cost($Vend::Items) > $credit) {
pop @{$Vend::Items};
}
}
something like that in a globalsub would do.
--
Anthony Ball ant@maine.com
MaineStreet Communications, Inc 208 Portland Road, Gray, ME 04039
tel:1.207.657.5078 fax:1.207.657.5048 http://www.maine.com/
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list