close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Best way to implement discounts

Thread began 11/30/2009 1:17 pm by david.aprice316413 | Last modified 2/04/2010 1:02 pm by Eric Mittman | 4006 views | 15 replies |

david.aprice316413

Best way to implement discounts

I was wondering if anyone can offer some suggestions on how I can implement a discounts feature to my site.

My client wants to give a % discount when the number of items exceeds x value (i.e. 500) but they want to manage the % themselves through the backend pages I am building for them. They also want the ability to offer free delivery (shipping) if the order value exceeds x amount.

Ok so how do I go about this? By the way this is the first time I am trying discounts. I assume I pass the % in a session variable but I'm not entirely sure how to pass the variable into the calculation. I have read through forums and the help documents but I've not really been able to grasp the best way to implement this.

Thanks

Dave

Sign in to reply to this post

Jason ByrnesWebAssist

the first place a discount will be applied to the cart is on the cart display page.


Create a recordset on this page to look up the discount amount, then use the eCart set session value server behavior to store it in a session. Set the trigger to before page loads. Set the name to "discountAmt", then click the lightning bolt next to value and select the recordset column.


When creating the discount in ecart, set the trigger to:
subtotal For any Column:
if the subtotal of column "Quantity" is ">" a value of "500"

then for the calculation use:
Based on Multiple of Column Subtotal:
subtotal of column "TotalPrice" "Times" "$_SESSION['discountAmt']" "Plus" "0"



for the free shipping, set the shipping rule trigger to:
Subtotal For any column:

If the subtotal of "TotalPrice" is "<" a value of "500"

this way shipping will only be applied if the subtotal is less then $500

Sign in to reply to this post

david.aprice316413

Thanks for the feeback i'll give it a try

Dave

Sign in to reply to this post

joe159765

Single Item

Ok so how to we apply this to only a certain item dynamically. Say I have 20 of one item and 6 of another item... As it stands with this calculation a discount is taken off the subtotal of those items because it is over 25 items (my calculation is over 24 items and under 50 items multiple by .10 for a 10% discount)

I want it to only apply to the one item even if another item is in the cart.

Hope this makes sense.

Thanks.

Sign in to reply to this post

Eric Mittman

Would you like the same discount rule triggered on the presence and quantity of a particular item, or would you like the discount to only take into consideration the one item and discount only that one item?

If you wanted to just update the trigger for this discount to be based on the quantity of a particular item then you can just adjust the current trigger you have to make it based on the 'Quantity of a specific item in the cart' and specify the id of the item. The rest of the discount should be the same.

If you want to have this only trigger on the item and apply only to that items subtotal you will need to also adjust the calculation portion. You will need to set it to 'Based on an item's column value', then specify the item id and choose the total price column.

Sign in to reply to this post

joe159765

There are two types of items. And there has to be a certain number of that particular item to get the discount. So let's say there's printed materials and printed books. Well each of these have a bunch of different ones in them. So printed material a has to have x number before discounted while printed material b can not add to that number to get the discount. Hope that makes sense. And prited books gets a different percent off. Thanks.

Sign in to reply to this post

Eric Mittman

Do you store the type of the item in a cart column? If so then you can do it the same way I suggested but you will use this column that holds the type of item rather than the item id.

Sign in to reply to this post

joe159765

understand what you are saying and I will be creating that column the only problem with that and I haven't tried your suggestion out today but it seems like it will discount whatever is a certain type. Meaning if I have 23 of item1 and 5 of item2 and it is set to discount of volume of more than 25 then all of it will be discounted. But it should only discount item1 if it's 25 or more and not item2 even though they are the same type. Thanks for your quick replies today.

Sign in to reply to this post

Eric Mittman

I think I see your point here. If you want the discount to apply to any item so long as it has a quantity of 25 or more you should use calculations to do this.

You should have two new calculated columns that will check if the quantity is 25 or greater and the type. You will figure the total discount for that line item based on the TotalPrice column. You will have one calculated column for each item type.

This way in the end you can have a blanket discount rule that will give you a total discount based on the subtotal of the new calculated columns. Here is an example of what one of the calculated columns will look like:

[php]
Type1QuantityDiscount
abs([Quantity] >= 25 && [ItemType] == 1) *( [TotalPrice] * .10)
[php]

This example would check if there is 25 or more of of the item and if it is type 1, of so the column will hold the value of the totalprice for the line item times .10. This will make this column hold 10% of the subtotal for that line item.

Sign in to reply to this post

joe159765

Awesome. I will give that a try and report back. Thanks a ton for your help.

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...