close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Applying Discounts to Only Certain Items

Thread began 9/29/2009 4:57 pm by duncanc213061 | Last modified 10/05/2009 11:08 am by Jason Byrnes | 2840 views | 9 replies |

duncanc213061

Applying Discounts to Only Certain Items

I am trying to apply discounts to certain items. If a customer buys six golf clubs, then no discount. If customer buys 7 golf clubs, then the 7th one is at an $18.00 discount. If customer buys 8 golf clubs, then the 8th one is an additional $18.00 discount.

I have tried every combination (I think), but I cannot get the discounts to work (without some major mathmatical acrobatics.

I do not want to change the structure of the database (only as a last resort). You should be able to do discounts directly in eCart.

I have been working on this for quite some time, and I am at my wits end. Please help!!

Sign in to reply to this post

Jason ByrnesWebAssist

Your cart will need to have a column for category to determine whether the discount should be applied or not.

this calculation assumes the category is set to "1" in the add to cart button for golf clubs:

Set the TotalPrice calculation to:
(([Price] * [Quantity]) - (([Quantity]>6 && [category]=='1')?(([Quantity]-6)*18):0))

if you want to display the savings, create an new calculation called savings:
([Price] * [Quantity]) - (([Price] * [Quantity]) - (([Quantity]>6 && [catagory]=='1')?(([Quantity]-6)*18):0))


When you create your cart display page, on the second page off the disp[lay manager, you can select columns to show, click the plus button and select the saving calculation to show it in the cart display.

Sign in to reply to this post

duncanc213061

Applying Discounts to Only Certain Items

Thanks for the reply.

I will give it a whirl tommorrow, as I am brain-dead today. Will this affect any other products in the store. I want it for only 2 types of clubs (those that have a minimum of 6 clubs).

Thanks in advance.

Sign in to reply to this post

Jason ByrnesWebAssist

as long as you have a category column in the cart and you set it to 1 for items it should apply to and 0 for items it should not apply to, it will not affect those it should not apply to.

Sign in to reply to this post

duncanc213061

Applying Discounts to Only Certain Items

i have used the calculations that you provided and I get this error:

Technical Information (for support personnel)

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/drbirdie/WA_eCart/birdie_VB.asp, line 294, column 77
itmObj.TotalPrice = ((itmObj.Price * itmObj.Quantity) - ((itmObj.Quantity>6 && itmObj.category=='1')?((itmObj.Quantity-6)*18):0))'c
----------------------------------------------------------------------------^

I have enclosed a zip file that has the two files (Rissa_2.asp, and birdie_vb).

I also have a second set of clubs that have a minimum of six clubs, and the 7th is discounted at $15.00 and the eighth is discounted at an additional$15.00, and so on. Am I required to have a second category for the discounts, or am I going to modify the database for this?

I am confused about the discounts for this, as the other discounts are working properly.

Attached Files
rissa.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I did not realize you where using ASP, the calculations where writen for PHP. In asp the calculations should be:
Set the TotalPrice calculation to:
(([Price] * [Quantity]) - (([Quantity]>6 &[category]='1')?(([Quantity]-6)*18):0))

if you want to display the savings, create an new calculation called savings:
([Price] * [Quantity]) - (([Price] * [Quantity]) - (([Quantity]>6 & [catagory]='1')?(([Quantity]-6)*18):0))


You will either need to crate a second category, or add another column for named DiscountAmount you would need to add that column to the database as well, and change the calculation to:
Set the TotalPrice calculation to:
(([Price] * [Quantity]) - (([Quantity]>6 && [category]=='1')?(([Quantity]-6)*[DiscountAmount]):0))

if you want to display the savings, create an new calculation called savings:
([Price] * [Quantity]) - (([Price] * [Quantity]) - (([Quantity]>6 && [catagory]=='1')?(([Quantity]-6)*[DiscountAmount]):0))

Sign in to reply to this post

duncanc213061

Applying Discounts to Only Certain Items

I have tried it again, and I am getting the error:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/drbirdie/WA_eCart/birdie_VB.asp, line 294, column 93
itmObj.TotalPrice = ((itmObj.Price * itmObj.Quantity) - ((itmObj.Quantity>6 &itmObj.category='1')?((itmObj.Quantity-6)*18):0))'w
--------------------------------------------------------------------------------------------^

Also, it does not like the character ' after itmObj.category= '1', as it comments out the last of the calculation.

Sign in to reply to this post

Jason ByrnesWebAssist

Sorry, for asp the correct calculation is:
TotalPrice
(([Price] * [Quantity]) - (Abs([Quantity]>6 AND [category]="1")*(([Quantity]-6)*18)))



Savings:
([Price] * [Quantity]) - (([Price] * [Quantity]) - (Abs([Quantity]>6 AND [category]="1")*(([Quantity]-6)*18)))

Sign in to reply to this post

duncanc213061

The cart page is still causing the price to show as full price, rather than the discounted price.

Each club less than six is $46.00, and the seventh through tenth clubs are discounted at $28.00.

There must be another step that I am not seeing.

Am I missing something here??

Sign in to reply to this post

Jason ByrnesWebAssist

Create a new cart display page for testing purposes,

When you apply the Cart Display Manager to the page, on the Second step of the Cart Display Wizard, click the Plus button and select All so the cart display will show all columns that are in the cart.

When you add a club to the cart, does the category column have a value of 1?

The calculation I gave you relies on the category column being given a value of 1 for items that should be given the discount.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...