How to redirect to a page from category filter?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

How to redirect to a page from category filter?

Post by t_csaba » 27 Sep 2019, 14:22

Hi,

I have a small problem with redirecting the catalog filter to a certain page.
This is my whole setup right now, i would like to redirect everyone who clicks on a category to a certain page, where i have my catalog list. Could you please help me out? What am I missing here?

Code: Select all

#header category menu
lib.navcat = COA
lib.navcat.10 = USER
lib.navcat.10 {
        userFunc = TYPO3\CMS\Extbase\Core\Bootstrap->run
        vendorName = Aimeos
        extensionName = Aimeos
        pluginName = catalog-filter
        controller = Catalog
        action = filter
        settings.controller.frontend.catalog.levels-always = 5
        settings.controller.frontend.catalog.levels-only = 10
        settings.client.html.catalog.filter.standard.template-body = catalog/filter/body-navcats
        settings.client.html.catalog.filter.standard.subparts{
            0 > #search
            1 = tree
            2 > #supplier
            3 > #attribute
        }
        settings.client.html.catalog.lists.url.target = 17
        settings.client.html.catalog.suggest.url.target = 10
        settings.client.html.catalog.count.url.target = 9
        settings.client.jsonapi.url.target = 2
}
typo3: 9.5.8
aimeos: 19.7.1
php: 7.2.5, Linux

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

Re: How to redirect to a page from category filter?

Post by aimeos » 27 Sep 2019, 15:19

You have to select the page you want to redirect in the flexform configuration of the catalog filter plugin. Setting it in the Setup TypoScript doesn't work because TYPO3 overwrites that with the empty flexform value if not set in the flexform.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

Re: How to redirect to a page from category filter?

Post by t_csaba » 30 Sep 2019, 07:42

I use the same setup for a search bar in the header, where the page target is the same, and there the url redirect is working. Could it be something else?

t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

Re: How to redirect to a page from category filter?

Post by t_csaba » 01 Oct 2019, 13:58

Also, i have noticed that in the generated html, the form is rendered like this:

Code: Select all

<form method="GET" action="/shop?ai%5Bcontroller%5D=Catalog&amp;ai%5Baction%5D=list">
But the individual links are rendered like this:

Code: Select all

<a class="cat-item" href="/?ai%5Bf_name%5D=Laptops,_tablets_and_mobile&amp;ai%5Bf_catid%5D=2&amp;ai%5Bcontroller%5D=Catalog&amp;ai%5Baction%5D=list">
So I know that the typoscript config is OK ( "shop" is the page where i want to redirect )

t_csaba
Posts: 25
Joined: 12 Oct 2017, 13:28

Re: How to redirect to a page from category filter?

Post by t_csaba » 01 Oct 2019, 14:07

Fixed it, I had to add this to my setup:

Code: Select all

settings.client.html.catalog.tree.url.target = 17

Post Reply