Hello you guys! I am working on a function for an online product catalog and I cant seem to figure out how to go about doing the following.
1. Individual products on the cart have the ability for the user to choose the quantity.2. My client asked me to give discounts of 20 dollars when they purchase two items.3. My question was, if they got three items, then they would get off 20 dollars for two items, but one item would be priced at regular price. What if they buy 4 items then they would get 40 dollars off. Do you guys see the pattern?
this is my task and perhaps I can get some input on how to go about doing this:
– I would have to discount 20 when 2 products are chosen, 40 when 4 products are chosen, 60 when 6 are chosen, etc.,
– the function would also have to discount odd quantity numbers for example: 1 would equal regular price, 3 would egual 20 dollars off but one at regular price, 5 would egual 40 dollars off but one at regular price, etc.,
Can this be done?? any suggestions are greatly welcomed ?