Still get error "Coupon code not found. Please try again." when case sensitive is set to no


  • Default avatar
    kimberly9    
     11 years ago
    0

    I set "case sensitive" to "no" so that my customers can put the code in with any variation of capital and lower case letters. The coupon works and shows the discount, but it still gives the error "Coupon code not found. Please try again" at the top of the page.

    Why is the error still showing when the coupon works? This confuses my customers.

  • Your avatar
    seyi    
     11 years ago
    0

    Yes, there has been a bug identified and will be updated in the next version. You can update it now
    www/administrator/components/com_awocoupon/helpers/estore/estorecouponhandler.php, around line 255 is

    <?php
                
    foreach($coupon_rows as $tmp) {
                    if(
    trim($tmp->coupon_code)==$submitted_coupon_code) {
                        
    $is_found true
                        break;
                    }
                }
    ?>


    change it to to
    <?php
                
    require_once JPATH_ADMINISTRATOR.'/components/com_awocoupon/helpers/awocouponModel.php';
                require_once 
    JPATH_ADMINISTRATOR.'/components/com_awocoupon/models/config.php';
                
    $cmodel = new AwoCouponModelConfig();
                
    $iscaseSensitive $cmodel->getCaseSensitive();
                foreach(
    $coupon_rows as $tmp) {
                    if(
                        (
    $iscaseSensitive && trim($tmp->coupon_code)==$submitted_coupon_code)
                    ||    (!
    $iscaseSensitive && strtolower(trim($tmp->coupon_code))==strtolower($submitted_coupon_code))
                    
                    ) {
                        
    $is_found true
                        break;
                    }
                }
    ?>
  • Default avatar
    kimberly9    
     11 years ago
    0

    I'll try it...thank you for your prompt response.

    Kim