Automatic Discounts not working - 500 error


  • Default avatar
    icon84    
     9 months ago
    0

    Hi,

    Installed Awo 2.4.6 and using HikaShop Business: 2.6.1

    Added a coupon and made it automated.

    Made an order and went to checkout and got a 500 error.
    [17-Feb-2016 11:20:06 Australia/Sydney] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8192 bytes) in /home/tbsahprint/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 39

    Current limit 128mb, increased to 256mb and got the following 500 error:


    [17-Feb-2016 11:22:18 Australia/Sydney] PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 8208 bytes) in /home/tbsahprint/public_html/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php on line 79

    Increased to 512Mb and got Internal Server Error.

    I unpublished the automatic discount and the checkout page works.

    Hope you can help



  • Your avatar
    seyi    
     9 months ago
    0

    Hello,

    Yes this problem seems to have happened after the last update.

    In the file
    www/administrator/components/com_awocoupon/helpers/estore/hikashop/couponhandler.php, around line 968 is this block of code:
    <?php
            $cart 
    = new stdClass();
            
    $cart->products = &$this->cart_products;
            
    $cart->cart_id = (int)@$cartclass->cart->cart_id;
            
    $cart->cart_type = @$cartclass->cart->cart_type;
            
    $cart->cart_params = @$cartclass->cart->cart_params;
            
    $cart->coupon null;
            
    $cart->shipping null;
            
    $cart->total = &$this->order_total;
            
    $cart->additional = array();
            
            
    JPluginHelper::importPlugin('hikashop');
            
    JPluginHelper::importPlugin('hikashoppayment');
            
    JPluginHelper::importPlugin('hikashopshipping');
            
    $dispatcher JDispatcher::getInstance();
            
    $dispatcher->trigger('onAfterCartProductsLoad', array( &$cart ) );
    ?>


    Please delete it. Should fix the issue.
  • Default avatar
    icon84    
     9 months ago
    0

    Hi seyi,

    Looks like it is working.

  • Default avatar
    cpaschen    
     8 months ago
    0

    We just experienced the same thing ... and this fix resolved it for us also.

    Please include the changes it in the next update.
  • Your avatar
    seyi    
     8 months ago
    0

    This update is in both 2.4.7 and 2.4.7.1 already. Maybe it did not get copied over when you manually copied it?
  • Default avatar
    cpaschen    
     8 months ago
    0

    AH ... ok ... maybe that.

    I'll make a note to watch for this on the next update (to make sure the change doesn't get lost).