remove ~f_catid from catalog url

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)
Spam and unrelated posts will be removed immediately!
User avatar
BorisZaguzov
Posts: 2
Joined: 29 May 2024, 23:02

remove ~f_catid from catalog url

Post by BorisZaguzov » 15 Jul 2024, 17:50

Hello!
Please help me!
How i can remove ~f_catid (sample: /catalog/raspylitel~56) from url catalog link?
Need use like this: /catalog/raspylitel/
How i can made this?

if remove only from routes:

Code: Select all

Route::match(array('GET', 'POST'), '{f_name}~{f_catid}/{l_page?}', array(
    'as' => 'aimeos_shop_tree',
    'uses' => 'Aimeos\Shop\Controller\CatalogController@treeAction',
))->where(['locale' => '[a-z]{2}(\_[A-Z]{2})?', 'site' => '[A-Za-z0-9\.\-]+', 'f_name' => '[^~]*', 'f_catid' => '[^~]*', 'l_page' => '[0-9]+']);
give 404 error

Aimeos 2023.x. Can't update on last version!

Thanks

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

Re: remove ~f_catid from catalog url

Post by aimeos » 17 Jul 2024, 11:50

If you use the Aimeos distribution, set SHOP_MULTIROUTE to "1":
https://github.com/aimeos/aimeos#multi-routing

If you need to do it yourself, check the related code in the Aimeos distribution:
- https://github.com/aimeos/aimeos/blob/b ... hp#L47-L55
- https://github.com/aimeos/aimeos/blob/b ... hp#L25-L60
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

User avatar
BorisZaguzov
Posts: 2
Joined: 29 May 2024, 23:02

Re: remove ~f_catid from catalog url

Post by BorisZaguzov » 24 Jul 2024, 21:35

So, now /catalog/ 404 error. How solved this?

And one more question. How use POST parametrs in filter?
Now: "/catalog/all?f_search=&f_price%5B0%5D=0&f_price%5B1%5D=1000000&f_attrid%5B%5D=67"
Need made only "/catalog/all" and filter must be used by POST, but hide in url

Thanks

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

Re: remove ~f_catid from catalog url

Post by aimeos » 28 Jul 2024, 09:35

BorisZaguzov wrote: 24 Jul 2024, 21:35 So, now /catalog/ 404 error. How solved this?
"/catalog" isn't a URL segment used by Aimeos.
BorisZaguzov wrote: 24 Jul 2024, 21:35 And one more question. How use POST parametrs in filter?
Now: "/catalog/all?f_search=&f_price%5B0%5D=0&f_price%5B1%5D=1000000&f_attrid%5B%5D=67"
Need made only "/catalog/all" and filter must be used by POST, but hide in url
You can change GET to POST here but we don't recommend that because it has some negative consequences:
https://github.com/aimeos/ai-client-htm ... y.php#L115
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply