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!