/shop make list view default view

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!
samvara
Posts: 5
Joined: 14 Mar 2023, 09:04

/shop make list view default view

Post by samvara » 24 Jun 2023, 09:29

Hi!

Is there a configuration option to make list view the default view on /shop

Thanks,
samvara.

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

Re: /shop make list view default view

Post by aimeos » 26 Jun 2023, 07:18

The simplest way is to add a redirect to your ./routes/web.php file:

Code: Select all

    Route::get('/', function () {
        return redirect(airoute('aimeos_shop_list'));
    });
The better option is to add the list component to the home page in ./config/shop.php:

Code: Select all

	'page' => [
		// Docs: https://aimeos.org/docs/latest/laravel/extend/#adapt-pages
		'catalog-home' => ['locale/select','basket/mini','catalog/filter','catalog/tree','catalog/search','catalog/price','catalog/supplier','catalog/attribute','catalog/session','catalog/stage','catalog/lists'  ],
	],
Additionally, you have to overwrite the catalog list view template using:

Code: Select all

mkdir -p resources/views/vendor/shop/catalog/
cp ./vendor/aimeos/aimeos-laravel/views/catalog/list.blade.php resources/views/vendor/shop/catalog/home.blade.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply