close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How do I create a discount based on a session variable and specific items in the cart?

Thread began 6/14/2014 1:52 am by mora398588 | Last modified 6/17/2014 4:38 pm by mora398588 | 518 views | 4 replies


How do I create a discount based on a session variable and specific items in the cart?

There are four products we are looking to offer on our website. I have created a static "Add to Cart" button for each item and gave them a unique ID, such as 1, 2, 3, and 4.

I attempted to create a discount based on a session variable (userLevel) and specific items in the cart (i.e., the products outlined above). After including the Session variable condition (where userLevel = 1), I inserted the next condition with an AND separator (if presence of item 1 = = true). I them proceeded to include the next condition, but with an OR separator (if presence of item 2 = = true), and so on up to item 4 - each with OR separators. The calculation is based on items with a specific value, (Total of TotalPrice where Discountable has a value of 2 times .25).

I then proceeded to create two more discounts using the same conditions and separators for userLevel 2 and userLevel 3.

Now, here is the issue (if you have not discovered it already), when I tested the discount on my testing server (logged in under userLevel 1), the cart returned the correct discount for Item 1. When I cleared the cart and added Item 2, the cart returned all the discounts I created for userLevels 1, 2 and 3.

I am certifiably confused. Each discount is based on a Session Variable equal to the userLevel. The discounts based on Session variable userLevel 2 or 3 should not even show up - since I am logged in only under userLevel 1. I attempted to replace the OR separators for Items 2, 3 and 4 with an AND separator. Of course, that didn't work either.

I would welcome any assistance or clarification you can provide me. Thank you for your time in advance!

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





Ease of use


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