Coupon code not valid


  • Default avatar
    jhilverink    
     11 years ago
    0

    Hi,

    We are generating coupons by AcyMailing. There are many coupons but the all not working.

    VM respont with:

    •UegNJN: Deze kortingcode is niet geldig

    VM version 2.0.20a
    Jommla 2.5.6
    AWO 2.1.7

    Any suggestion?

    Regards,
    Joop.
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    Have you tried going to awocoupon->configuration and changing all the error messages to something identifiable then trying it on the front end to see why it is failing?

    If you would like me to have a look directly please pm admin access.
  • Default avatar
    jhilverink    
     11 years ago
    0

    Hi Seyi,

    It looks like AwoCoupon is not activated ad all.

    Regards, Joop.
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    I took a look and think I figured out the problem. Every code I looked at, I looked at about 10 of them, has a bad format. Take for example code UegNJN, it is in this format
    _UegNJN

    Where _ represents a space.

    In one of the codes, I removed the space and it was accepted in the front end.

    I am not sure why they all have spaces at the beginning, but i think removing those would fix the problem.
  • Default avatar
    jhilverink    
     11 years ago
    0

    Thank you.

    These codes are generated by AcyMailing.

    I have to find out why.

    Thanks for your help.

    Regards, Joop.
  • Your avatar
    seyi    
     11 years ago
    0

    Hello,

    I am not sure what is causing it but we can stop it from happening in the code I believe. Try this

    in plugins/acymailing/awocoupon/awocoupon.php, around line 280 is this:
    <?php
        $coupon_code 
    str_replace(    array('[name]','[subid]','[email]','[key]'),
                                    array(
    $user->name,$user->subid,$user->email,$key),
                                    
    $coupon_rule);
    ?>


    change it to this:
    <?php
        $coupon_code 
    trim(str_replace(    array('[name]','[subid]','[email]','[key]'),
                                    array(
    $user->name,$user->subid,$user->email,$key),
                                    
    $coupon_rule));
    ?>


    I think that should fix it.
  • Default avatar
    jhilverink    
     11 years ago
    0

    Hi Seyi,

    I'm not sure if I do this on the proper way.
    In my awocoupon.php file it looks different.
    To find out why this leading space is there, I looked into AcyMailing and find this in my newsletter document:

    Uw kortingcode is: {awocoupon: [key]|8|10|1}

    When I make a new tag, it looks like this.

    {awocoupon:[name][key]|8|[na]|[na]|[na]|[na]}

    There exist a field "name" .
    Is it possible that there is a space between "name" and "key".
    removing "name", leave’s space and "key"?

    Regards, Joop.



  • Default avatar
    jhilverink    
     11 years ago
    0

    Hi Seyi,

    I found out what is causing it. It is the leading space in the coupon code.
    {awocoupon: [key]|8|[na]|[na]|[na]|[na]}

    Between Awocouponcode: and [key] is placed a space.

    Removing this space is solving the problem.

    Thanks very much for your help.

    Regards, Joop.
  • Your avatar
    seyi    
     11 years ago
    0

    Great, glad its working. You are welcome.