Page 1 of 1

Feature: Do not allow checkout without a coupon

PostPosted: Wed Jul 31, 2013 1:35 pm
by admin
We've had a recent request not to allow the submission of the order without a use of a coupon. This feature is used especially if you sell gift certificates (outside the shop) and your shop will allow the purchases only when those gift certificates (coupons with awo coupons) are used.

The only modification that needs to be done is within your themes in /components/com_onepage/themes/onepage.unlogged (and logged).tpl.php

Just add this code to the end:
Code: Select all
<script type="text/javascript">
function checkCoupon(wasValid)
{
   
   coupon = getCouponCode();
   if (coupon != null)
      if (coupon == '')
                 {
                 alert('You must use a coupon before submitting the order');
       return false;
                 }
   return wasValid;
}
addOpcTriggerer('callSubmitFunct', 'checkCoupon');
</script>