Javascript is not my usual programming language, but something like this should work. The idea is to apply each time the best discount. To know how many times you can apply a discount you just need to take the quotient of the division between the remaining bought items and the...
There is an event in magento, sales_quote_collect_totals_after This is fired whenever your total is calculated, what you can do is set a flag in session on click on the button to apply discount, and in this above event's observer method, check if it is set then apply discount. In your...
You have more than one bug. First, in the else of the first if, you don't compute seat_total, so following computations will crash -- you just do print ('The total amount for your seats is: $'),user_people * 5180 rather than the obviously needed seat_total = user_people * 5180 print ('The...
sql-server-2008,stored-procedures,calculated-columns,discount
You can use the coalesce function in a similar way that you are using the IsNull function. There are some subtle differences between IsNull and Coalesce, but the significant difference that would benefit your code is that you can have multiple parameters without needing to nest it. Your code: Isnull(id.rabatt,...