Class "CouponHelper" not found...


  • Default avatar
    carmine    
     11 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    
     11 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    
     4 years ago  last edited 4 years 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)){</span><span style="background-color:transparent;color:rgb(0,0,0);font-family:Arial;font-size:11pt;white-space:pre-wrap;">
        if (!
    class_exists('CouponHelper')) {
            require(
    VMPATH_SITE DS 'helpers' DS 'coupon.php');
        }
    </
    span><span style="font-size:11pt;font-family:Arial;color:#000000;background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap;">    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.