Class "CouponHelper" not found...


  • Default avatar
    carmine    
     6 years ago
    0

    Hello. Installation is Joomla 2.5.7, AWOCoupon Pro 2.1.5

    I can create and add coupons in the front end. When I get to the payment page, I receive the following error:

    Fatal error: Class 'CouponHelper' not found in /home/michaela/public_html/_systest/administrator/components/com_virtuemart/models/orders.php on line 618

    Any ideas what might be happening?

    Thanks,
    Carmine
  • Your avatar
    seyi    
     6 years ago
    0

    Hello,

    That is strange, that class should exist before that function is called. Ok, you can try opening up the file with the fatal error, find the line which should be on line 618

    <?php
        CouponHelper
    ::RemoveCoupon($_cart->couponCode);
    ?>


    and add this right before that line
    <?php
        
    if (!class_exists('CouponHelper')) {
            require(
    JPATH_VM_SITE DS 'helpers' DS 'coupon.php');
        }
    ?>


    That should fix it.
  • Default avatar
    doug70    
     11 days ago  last edited 11 days ago
    0

    I experienced a similar error when returning to my site after payment is processed on the PayPal site. (Virtuemart 3.2.14, Joomla 3.9.1, AwoCoupon 3.5.6.9 -- I had not experienced this error with AwoCoupon 2.?)

    It turned out that modifying the components/com_virtuemart/helpers/cart.php file to add the following:


    <?php
    if (!class_exists('CouponHelper')) {
        require(
    VMPATH_SITE DS 'helpers' DS 'coupon.php');
    }
    ?>

    in the emptyCartValues function, in the following context:

    <?php
    if(!empty($cart->couponCode)){
        if (!
    class_exists('CouponHelper')) {
            require(
    VMPATH_SITE DS 'helpers' DS 'coupon.php');
        }
        
    CouponHelper::setInUseCoupon($couponCodetrue1);
    }
    ?>

    solved the problem.


    I am putting this information here because I found this thread while looking for information on a "class 'CouponHelper' not found" error.