|Discounts on Volume|
|Discounts on Volume|
Author Bradley Edwards on 03-19-2002 at 09:12 (EST)
I have a question in regards to discounts.
Is there a way to do a disount on volume?
In other words, can the cart automatically apply a 20% discount if the total amount exceeds $75.00. I didn't see anything about this type of discount, but thought I'd ask anyway.
|Messages In This Discussion|
| 1. RE: Discounts on Volume|
Author Bill Weiner on 03-19-2002 at 22:25 (EST)
|Unfortunately, there isn't a way to setup a discount based on the subtotal at this time. There is the "Global Discount" setting which allows you specify a specify discount percentage or amount... but there's no way to tie it in to the subtotal at this time.... unless you want to make a slight modification to the script, as described below:|
STEP 1: Make a backup of your current "ustorekeeper.pl" script... just in case.
STEP 2: Open your ustorekeeper.pl script with any text editor such as WordPad.
STEP 3: Do a search on the following line in order to get the start of the subroutine that reviews the order information and calculates the final totals:
STEP 4: Locate the following line in that subroutine:
if (($global_discount =~ /S/) && ($global_discount ne "NONE"))
STEP 5: And change that line to:
if (($global_discount =~ /S/) && ($global_discount ne "NONE") && (&get_subtotal($customer_id,0) >= 75.0))
(Where 75.0 is the subtotal for which the discount applies)
STEP 6: Save the script... as TEXT if your editor asks... and try it out!
| 2. RE: Discounts on Volume|
Author Bradley Edwards on 03-20-2002 at 16:14 (EST)
|Thanks guys, it worked perfectly! Outstanding as always.|
I did the following:
if (($global_discount =~ /S/) && ($global_discount ne "NONE") && (&get_subtotal($customer_id,0) >= $global_discount))
# 34. Global Order Discount
# (Discount orders over this amount)
$global_discount = "50.0";
to the ustorekeeper-lib.pl, so I can change the amount there along with all the other mods I have made.
Nest time I have to upgrade, I have a feeling I'm going to be sorry. :)
| 3. RE: Discounts on Volume|
Author Bradley Edwards on 03-20-2002 at 16:29 (EST)
Actually I found the following problem...
When the order is initially, placed everything works great. I set the discount to be $50 or more, so once the amount reaches $50 the discount is applied.
However, before I finalize the order, if I go back, and remove something from the cart, so that the total is below $50, it will still give the discount.
Is there an easy fix for this?
Thanks in advance!
| 4. RE: Discounts on Volume|
Author Bill Weiner on 03-20-2002 at 22:21 (EST)
|The aforementioned changes should cause the discount to be re-calculated each time the customer goes to the review order page (the page after the order form is filled out). If that is not the case, give me the URL so that I can see what's actually happening.|
| 5. RE: Discounts on Volume|
Author Bradley Edwards on 03-22-2002 at 01:19 (EST)
For some reason, using it with the "variable" as I outlined in the earlier post, it does some weired calculations, but if I just put it in as you specified, it works perfect.