Error on PHP8


  • Default avatar
    thomas973    
     2 years ago
    0

    Hi
    I'm getting AwoCoupon errors when using PHP8 on https://tasteofport.dk/shop/kurv (the basket page, so you might need to put something in it to se the error)

    This is the error:

    current(): Argument #1 ($array) must be of type array, null given
    /var/www/vhosts/tasteofport.dk/httpdocs/plugins/hikashop/awocoupon/awocoupon.php:208

    Call stack # Function Location 1 () JROOT/plugins/hikashop/awocoupon/awocoupon.php:208 2 current() JROOT/plugins/hikashop/awocoupon/awocoupon.php:208 3 plgHikashopAwoCoupon->onHikashopAfterDisplayView() JROOT/libraries/joomla/event/event.php:70 4 JEvent->update() JROOT/libraries/joomla/event/dispatcher.php:160 5 JEventDispatcher->trigger() JROOT/libraries/src/Application/BaseApplication.php:108 6 Joomla\CMS\Application\BaseApplication->triggerEvent() JROOT/administrator/components/com_hikashop/helpers/helper.php:2608 7 hikashopView->display() JROOT/components/com_hikashop/views/checkout/view.html.php:53 8 CheckoutViewCheckout->display() JROOT/libraries/src/MVC/Controller/BaseController.php:664 9 Joomla\CMS\MVC\Controller\BaseController->display() JROOT/administrator/components/com_hikashop/helpers/helper.php:2308 10 hikashopController->display() JROOT/components/com_hikashop/controllers/checkout.php:65 11 checkoutController->display() JROOT/components/com_hikashop/controllers/checkout.php:213 12 checkoutController->show() JROOT/libraries/src/MVC/Controller/BaseController.php:702 13 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/administrator/components/com_hikashop/helpers/helper.php:2286 14 hikashopController->execute() JROOT/components/com_hikashop/hikashop.php:88 15 require_once() JROOT/libraries/src/Component/ComponentHelper.php:402 16 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:377 17 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:194 18 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:233 19 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:225 20 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49
  • Your avatar
    seyi    
     2 years ago
    0

    Hello, in that same file


    /var/www/vhosts/tasteofport.dk/httpdocs/plugins/hikashop/awocoupon/awocoupon.php at line 204 is this:
    <?php
                $coupon_session 
    AC()->storediscount->get_coupon_session();
    ?>

    Right after that add this
    <?php
                
    if ( empty( $coupon_session ) ) {
                    return;
                }
    ?>

    That should fix it.
  • Default avatar
    thomas973    
     2 years ago
    0

    Thank you, seems to work!
    Will this be included in a future update?
  • Your avatar
    seyi    
     2 years ago
    0

    Yes it will.
  • Default avatar
    thomas973    
     2 years ago
    0

    Thank you!