Product Filter (Currency Reset Issue)

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Rafeel
Posts: 8
Joined: 21 Sep 2021, 07:42

Product Filter (Currency Reset Issue)

Post by Rafeel » 21 Sep 2021, 07:48

Hi,

Frontend - While apply the product filter on shop page, results loading with the default currency instead of the selected one.

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

Re: Product Filter (Currency Reset Issue)

Post by aimeos » 21 Sep 2021, 14:01

Did you set up your routes according to:
https://aimeos.org/docs/latest/laravel/ ... ze/#routes

In the current dev-master branch there's an improvement that prevents Laravel from throwing away the currency GET parameter if it's not part of the route.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Rafeel
Posts: 8
Joined: 21 Sep 2021, 07:42

Re: Product Filter (Currency Reset Issue)

Post by Rafeel » 22 Sep 2021, 07:40

Thank you.

Added the below routes with shop.php
'default' => ['prefix' => 'shop/{currency}', 'middleware' => ['web'] ],

Now filter is working as expected. But homepage getting the below error while try to access with direct domain (Ex: www.example.com). Earlier the same loaded with default currency.

Missing required parameters for [Route: aimeos_shop_list] [URI: {currency}].

Anything wrong with this one - 'default' => ['prefix' => 'shop/{currency}', 'middleware' => ['web'] ],

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

Re: Product Filter (Currency Reset Issue)

Post by aimeos » 23 Sep 2021, 13:56

As currency isn't an optional parameter, you have to add a route in your ./routes/web.php file that redirects to the default currency like:

Code: Select all

    Route::get('/', function () {
        return redirect('/EUR');
    });
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Rafeel
Posts: 8
Joined: 21 Sep 2021, 07:42

Re: Product Filter (Currency Reset Issue)

Post by Rafeel » 24 Sep 2021, 11:05

Thank you. Issue got resolved

Post Reply