[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: MV3:12 Discount Help Needed/ Gift Certificate
****** message to minivend-users from Ryan Hertz <rhertz@gyb.baits.com> ******
At 04:18 PM 5/3/99 , Russ wrote:
>****** message to minivend-users from "Russ" <russ@khouse.org> ******
>
>Hello,
>
>I am trying to implement a gift certificate system on a minivend store. I
>am tyeing the gift certificate to a login name on the userdb. Incidently, I
>give users a $5.00 discount just for creating an account, which I put in
>their userdb file as a gift certificate. This isn't the hard part. The
>hard part is getting the gift certificate amount to discount on the order.
>The logic I have in place is this:
>
>[if session logged_in]
><!--
>[calc]
>$currentbalance = [data base="userdb" field="balance" key="[data session
>username]"]
>[/calc]
>[calc]
>if ([subtotal] > $currentbalance)
>{
>$discountamount = $currentbalance
>}
>if ([subtotal]<$currentbalance)
>{
>$discountamount = [subtotal]
>}
>[/calc]
>-->
>[discount ENTIRE_ORDER]$s-$discountamount[/discount]
>[/if]
>
>This checks to make sure the subtotal is greater than the balance of their
>account (gift certificate amount). It makes the discount amount no larger
>than the subtotal and no larger than the balance of the account.
>
>The most recent problem I'm having is the discount ENTIRE_ORDER doesn't
>carry through the checkout process. It only shows up on the basket.html
>page where I originally code it. The only way to get the discount to show
>up for the entire order is to put this code on every page in the checkout
>process, including the report and reciept. That doesn't jive with the
>documentation, which indicates 'once discounted, always discounted'.
Your variables are not scoping correctly - I imagine that inside a [calc]
routine minivend will assume the variables to be local. ??
>
>Any ideas? Another problem is how to carry a value in the session to
>multiple pages. I want the $currentbalance and $discountamount to be
>carried to more pages than the basket.html. I'll need the discountamount at
>the reciept page so I know how much to decrement the gift certificate field
>in the userdb.
>
>Thanks in advance for any help,
>
>Russ
>--------------------------
>Earn Money to surf the Internet Click Here!
>http://www.alladvantage.com/refhome.asp?refid=AWW-495
Ryan Hertz tel 520-645-3812
Webmaster tel 800-645-BAIT
Advertising Director fax 520-645-2588
Gary Yamamoto Custom Baits, Inc. http://www.yamamoto.baits.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