Allow discounts to be searched by discount code. Closes #1710