Issue 167 again
Created by: h-c-c
The foreach loop at L363 goes through all discounts, so we have to break out when we hit our autodiscount. If the last one is our autodiscount then, a broken clock is right twice a day. ;-) (see workaround mentioned before.)
Also the discount message stuff at L447 stomps on the $discount object, leaving us withe the wrong $discount['id'].