Automatic Discount reports incorrect coupon code / no record, unpublished or expired


  • Default avatar
    InfluentialSoftware    
     7 years ago
    0

    Hi. We have a use case to give specific customers a specific discount so I am testing Create Automatic Discount as it looks as if it will do just what we need. https://awodev.com/blog/create-automatic-discount-awocoupon-pro

    I followed the documentation and setup a coupon, added in Automatic Discounts. Published in both lists. Multiple coupons allowed.

    When I go to cart for the selected customer, the discount amount shows up but there is an error "You have entered an incorrect coupon code..." I then selected debug and refreshed the cart and got "No record, unpublished or expired".

    Using Rupostel latest OPC 2.0.320 4 Nov 16, Joomla 3.6.3, VM 3.0.18 (we get the same on the J2.5/VM2.6 environment).

    Your help will be appreciated - any ideas?

    Thanks, Mike
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Are you using the latest version of AwoCoupon, 2.5.2?
  • Default avatar
    InfluentialSoftware    
     7 years ago  last edited 7 years ago
    0

    I am now, yes. Still the same error. I will delete the coupon and start afresh and post result.

    Regards

    Same result, I'm afraid. New coupon. Coupon Discount (Discount) of the right value £-5 shows up in the cart above the MOSS VAT line and the calculation of the total is correct. But still " (Discount): No record, unpublished or expired"

    What can I try next?

    Regards
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Ok, here is a solution, in the file www/administrator/components/com_awocoupon/helpers/estore/virtuemart/couponhandler.php, around line 902 is this:

    <?php
            
    if (version_compare($this->vmversion'2.9.8''>=') && $this->vmcoupon_code==JText::_('COM_VIRTUEMART_COUPON_CODE_CHANGE')) return '';
    ?>

    Right after that add this:

    <?php
            
    if($this->vmcoupon_code == '('.JText::_('COM_AWOCOUPON_CP_DISCOUNT_AUTO').')') return '';
    ?>

    That should fix it.

  • Default avatar
    InfluentialSoftware    
     7 years ago
    0

    OK, have done a couple of tests and you're right - that does seem to work. Thanks

    Regards, Mike