Okay
  Public Ticket #2556859
Category page throws error when MGS_Ajaxlayernavigation is enabled with PHP 7.4
Closed

Comments

  • anakorenini started the conversation

    Hi

    When opening category page with Layered Navigation and with I get following error:

    > Notice: Trying to access array offset on value of type int in /home/ana/sites/akrobat-shop/app/code/MGS/Ajaxlayernavigation/Model/Layer/Filter/DefaultFilter.php on line 121

    The error seems to go away if switch from PHP 7.4 to PHP 7.3. On production server I have PHP 7.4 so site won't work. Could you provide a path for PHP 7.4 support for this module?

    Best Regards,
    Borut K.

  • anakorenini replied

    Hi

    I have managed to resolve the error, so module now works in PHP 7.4.:

    In file `app/code/MGS/Ajaxlayernavigation/Model/Layer/Filter/DefaultFilter.php` after in method `_initItems` I have added following if inside `foreach`:

    if (!is_array($itemData)) {    
        continue;
    }

    After doing this there is no error anymore, but module still doesn't work correctly for filtering my attributes. For example if I click on filter checkbox whit (2) products - 2 is displayed in parentheses next to filter I get empty results (No products found). It happens for all filters in layered navigation, except Category and Price work correctly.

    How can I fix this?


  • anakorenini replied

    Hello

    I have uploaded the store to http://akrobat-staging.dev.kovinet.eu/sl/trampolini so you can see the problem in live.

    If you click any filter except "Kategorija" it gives empty result, which is wrong.

    Could you fix ASAP?

    BR, Borut

  • [deleted] replied

    Dear anakorenini,

    So sorry for making you feel inconvenient about our late reply

    Could you please give us your site info ( admin url, admin account and ftp access detail )? So we can specify whether or not your issue is a theme bug. We will update you as soon as possible

    Thank you and I hope you have a good day 

  • anakorenini replied

    Hi

    As mentioned before, if I disable Ajaxlayernavigation module then filtering is working fine, but with module enabled Custom Attribute filters all produce empty result. For example http://akrobat-stagin.dev.kovinet.eu/sl/trampolini/trampolini-za-uporabo-na-javnih-povrsinah?shape=7

    We are using configurable products in this category.

    BR,
    Borut

  •   anakorenini replied privately
  • [deleted] replied

    Dear anakorenini,

    Thank you for your reply

    Our devs have received your problem. They will check it soon

    I will update to you as soon as possible

    Have a good day

  • [deleted] replied

    Dear anakorenini,

    I hope you're doing well

    We have fixed the issue for you, you can check. Please check and respond to this ticket if the problem is still not fixed yet, we will check again. If we dont get any response from you in 2 days, we would suppose the issue is fixed and close this ticket. Please feel free to open a new ticket for any other issue or questions.

    Thank you and have a good day 

  • anakorenini replied

    Hi

    I have checked URL at http://akrobat-staging.dev.kovinet.eu/sl/trampolini but now it is not working at all. There is a Fatal Error:

    Error: Call to undefined method MGS\Ajaxlayernavigation\Helper\Config::defaultExpanded() in /home/akrobat-staging/public_html/app/code/MGS/Ajaxlayernavigation/view/frontend/templates/layer/view.phtml:66

    Pls check.


  • [deleted] replied

    Dear anakorenini,

    Thank you for your reply

    Our devs will check your problem again soon 

    I hope you have a good day

  • anakorenini replied

    Hello

    Are there any news regarding filters in layered navigation? 

    I am very close to deadline and this is a blocker for me. I have checked the site and I noticed some changes but filters are still not working, they are giving empty results. 

    I am waiting for good news from you about this. :)

    Best,
    Borut

  • [deleted] replied

    Dear anakorenini,

    I hope you're doing well

    We have fixed the issue for you, you can check. Please check and respond to this ticket if the problem is still not fixed yet, we will check again. If we dont get any response from you in 2 days, we would suppose the issue is fixed and close this ticket. Please feel free to open a new ticket for any other issue or questions.

    Thank you and have a good day 

  • anakorenini replied

    Hello

    The problem still persists and was not fixed. 

    If you go to URL http://akrobat-staging.dev.kovinet.eu/sl/trampolini and click any of the following filters: Tip trampolina, Oblika, Velikost -there is still no results found.

    Please check again.

    Best,
    Borut

  • [deleted] replied

    Dear anakorenini,

    Please clear cache then check again

    Thank you and have a good day 

  • anakorenini replied

    Hello

    I have cleared cache and there is no change. It is still not working.

    Please check.

    Best,
    Borut

  • [deleted] replied

    Dear anakorenini, 

    Sorry for the late reply due to our weekend

    We will check your problem again soon

    I will update to you as soon as possible

    Have a good day 

  • [deleted] replied

    Dear anakorenini, 

    Please upload file attached into your source code:

    Follow file readme.

    This is a problem between the ajaxLayernavigation and elasticsearch modules. The patch can solve this but it will not support multi filters for the time being. We are working to develop it and will update in the next theme upgrades

    Thank you and have a good day

  • anakorenini replied

    Hello

    Can you explain what do you mean by multi filters? It means I can have only one group in layered navigation else it won't work?

    Do you have any estimate when can you develop this and update theme as you mentioned?


    Best,
    Borut



  • [deleted] replied

    Dear anakorenini,

    Yes, Im afraid that

    We are still in improvement period

    We will upgrade it as soon as possible, please follow us on themeforest 

    Thank you and have a good day