Loading Catalog Filter via Ajax

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
mainfactory
Posts: 6
Joined: 06 Dec 2018, 12:33

Loading Catalog Filter via Ajax

Post by mainfactory » 24 Jan 2019, 16:03

Hi aimeos Team

Is there a possibility to load the catalog filter with Ajax (without a page reload)? After i activate a filter checkbox the page make a reload. Mainly we want to keep the focus on the filter after activating checkboxes... but because of the page reload the page always jumps to the top. This we can handle by javascript (for example with window.scrollTo() or scrollIntoView() ) but not completely - there is always a short disappearance of the page after every checkbox activation because of the page reload.

Typo3 Version 8.7.22
PHP 7.2
aimeos 18.10.02

Thank you for your support.

User avatar
aimeos
Administrator
Posts: 7865
Joined: 01 Jan 1970, 00:00

Re: Loading Catalog Filter via Ajax

Post by aimeos » 25 Jan 2019, 07:55

You can listen to the change event of the checkboxes and post the form data using a XHR request yourself. You will get back the HTML for the whole page but you can rip out the catalog list section and replace the existing one. That's pretty easy and we do in in the basket ourselves:
- https://github.com/aimeos/ai-client-htm ... os.js#L593
- https://github.com/aimeos/ai-client-htm ... os.js#L552
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply