EmicoEcommerce / Magento2Tweakwise

Magento 2 module for Tweakwise integration
Other
4 stars 16 forks source link

Not needed AJAX call during first visit in category page category #156

Closed sergiozt closed 2 months ago

sergiozt commented 7 months ago

Issue Brief

During first category page visit the AJAX call is sent (/tweakwise/ajax/navigation).

Steps to reproduce

  1. Install Magento from master branch.
  2. Open home pape
  3. Open category page

Actual result On the category page, the AJAX request (/tweakwise/ajax/navigation) is sent Triggered by https://github.com/EmicoEcommerce/Magento2Tweakwise/blob/v5.8.1/view/frontend/web/js/navigation-form.js#L44

Expected result On the category page, no AJAX request (/tweakwise/ajax/navigation) is sent until the filter is selected.

ah-net commented 7 months ago

@sergiozt This is needed so the back button (history) of the browser functions properly. If we don't do this and you go to another page. And go back using the browser button, the wrong products are shown.

I agree it's not ideal, but unless we can find another solution for that, this will not be fixed.

sergiozt commented 7 months ago

Hello @ah-net

Thanks for the reply. During high load, even though the category pages are cached, this script generates not needed extra traffic (load) to the server that we would like to avoid. Is this something you will investigate to fix? Maybe already planned? cc @RemcoWolterink Regards, Sergii

ah-net commented 7 months ago

@sergiozt @RemcoWolterink

We don't have anything planned for this currently. This is because we don't have an alternative solution for the original problem for this that doesn't have the same problem.

If you have an suggestion on how to fix the history (back button) of the browser (for the first page) without an extra request we can take another look at this.

ah-net commented 7 months ago

@sergiozt @RemcoWolterink

We do have something planned (rewrite of personal merchandising) that may fix this problem. But it's not guaranteed that it also fixes this problem.

sergiozt commented 7 months ago

Hello @ah-net Thanks for letting us know. Do you have the time when you plan to release that?

ah-net commented 6 months ago

@sergiozt I don't have an exact time for you. But it will be somewhere in the next couple of months.

ah-net commented 2 months ago

@sergiozt @remco-schouten

This issue has been solved in the 7.0 release. If you have varnish enabled, there is no second call anymore.

sergiozt commented 2 months ago

Good day @ah-net Many thanks for fixing the issue and the reply. cc @RemcoWolterink