title: How to create a coupon code in magento that will apply a percentage discount or a fixed value whichever is lower
body: <p>I want to implement a coupon code which will give the user 20% Off on their shopping cart if the value of the discount is less than 500.</p>
  
  <p>e.g. Total Cart Value is 10000
  20% coupon code applied would give a discount of 2000
  However the maximum discount that should be given is only 500.</p>