No item found for conditions: Array ( [locale.site.code] => shop )

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!
unknow76616
Posts: 48
Joined: 30 Apr 2023, 12:46

No item found for conditions: Array ( [locale.site.code] => shop )

Post by unknow76616 » 21 Sep 2023, 14:09

when i try to visit

Code: Select all

{site_domain}/shop
i get this error :

Code: Select all

[2023-09-21 14:02:48] local.ERROR: No item found for conditions: Array
(
    [locale.site.code] => shop
)
 {"exception":"[object] (Aimeos\\MShop\\Exception(code: 404): No item found for conditions: Array
(
    [locale.site.code] => shop
)
 at PATH/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Base.php:511)
[stacktrace]
#0 PATH/vendor/aimeos/aimeos-core/src/MShop/Locale/Manager/Site/Standard.php(432): Aimeos\\MShop\\Common\\Manager\\Base->findBase()
#1 PATH/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(153): Aimeos\\MShop\\Locale\\Manager\\Site\\Standard->find()
#2 PATH/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(153): Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->find()
#3 PATH/vendor/aimeos/aimeos-core/src/MShop/Locale/Manager/Standard.php(248): Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->find()
#4 [internal function]: Aimeos\\MShop\\Locale\\Manager\\Standard->bootstrap()
#5 PATH/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(51): call_user_func_array()
#6 [internal function]: Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->__call()
#7 PATH/vendor/aimeos/aimeos-core/src/MShop/Common/Manager/Decorator/Base.php(51): call_user_func_array()
#8 PATH/vendor/aimeos/aimeos-laravel/src/Base/Locale.php(70): Aimeos\\MShop\\Common\\Manager\\Decorator\\Base->__call()
#9 PATH/vendor/aimeos/aimeos-laravel/src/Base/Context.php(101): Aimeos\\Shop\\Base\\Locale->get()
#10 PATH/vendor/aimeos/aimeos-laravel/src/Base/Shop.php(42): Aimeos\\Shop\\Base\\Context->get()
#11 PATH/vendor/aimeos/aimeos-laravel/src/ShopServiceProvider.php(109): Aimeos\\Shop\\Base\\Shop->__construct()
#12 PATH/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Aimeos\\Shop\\ShopServiceProvider->Aimeos\\Shop\\{closure}()
#13 PATH/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build()
#14 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(937): Illuminate\\Container\\Container->resolve()
#15 PATH/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve()
#16 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(922): Illuminate\\Container\\Container->make()
#17 PATH/vendor/laravel/framework/src/Illuminate/Container/Container.php(1454): Illuminate\\Foundation\\Application->make()
#18 PATH/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(236): Illuminate\\Container\\Container->offsetGet()
#19 PATH/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(207): Illuminate\\Support\\Facades\\Facade::resolveFacadeInstance()
#20 PATH/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(347): Illuminate\\Support\\Facades\\Facade::getFacadeRoot()
#21 PATH/vendor/aimeos/aimeos-laravel/src/Controller/CatalogController.php(81): Illuminate\\Support\\Facades\\Facade::__callStatic()
#22 PATH/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): Aimeos\\Shop\\Controller\\CatalogController->homeAction()
#23 PATH/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\\Routing\\Controller->callAction()
#24 PATH/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch()
#25 PATH/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController()
#26 PATH/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\\Routing\\Route->run()
#27 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}()
#28 PATH/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#29 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle()
#30 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#31 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle()
#32 PATH/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#33 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle()
#34 PATH/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#35 PATH/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(64): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest()
#36 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Session\\Middleware\\StartSession->handle()
#37 PATH/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#38 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle()
#39 PATH/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#40 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle()
#41 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#42 PATH/vendor/laravel/framework/src/Illuminate/Routing/Router.php(800): Illuminate\\Pipeline\\Pipeline->then()
#43 PATH/vendor/laravel/framework/src/Illuminate/Routing/Router.php(777): Illuminate\\Routing\\Router->runRouteWithinStack()
#44 PATH/vendor/laravel/framework/src/Illuminate/Routing/Router.php(741): Illuminate\\Routing\\Router->runRoute()
#45 PATH/vendor/laravel/framework/src/Illuminate/Routing/Router.php(730): Illuminate\\Routing\\Router->dispatchToRoute()
#46 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(200): Illuminate\\Routing\\Router->dispatch()
#47 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}()
#48 PATH/app/Http/Middleware/SetLocale.php(25): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#49 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\SetLocale->handle()
#50 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#51 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#52 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull->handle()
#53 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#54 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle()
#55 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\TrimStrings->handle()
#56 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#57 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle()
#58 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(89): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#59 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle()
#60 PATH/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#61 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\HandleCors->handle()
#62 PATH/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#63 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\\Http\\Middleware\\TrustProxies->handle()
#64 PATH/app/Http/Middleware/TrustHosts.php(24): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#65 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\\Http\\Middleware\\TrustHosts->handle()
#66 PATH/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}()
#67 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(175): Illuminate\\Pipeline\\Pipeline->then()
#68 PATH/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(144): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter()
#69 PATH/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle()
#70 PATH/vendor/laravel/framework/src/Illuminate/Foundation/resources/server.php(16): require_once('...')
#71 {main}
"} 


.env

Code: Select all

SHOP_MULTISHOP=1
./routes/web.php:

Code: Select all

<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/ready', function() {
    return 'OK';
});

$params = [];
$conf = ['prefix' => '', 'where' => []];

if( env( 'SHOP_MULTILOCALE' ) )
{
    $conf['prefix'] .= '{locale}';
    $conf['where']['locale'] = '[a-z]{2}(\_[A-Z]{2})?';
    $params = ['locale' => app()->getLocale()];
}

if( env( 'SHOP_MULTISHOP' ) )
{
    $conf['prefix'] .= '/{site}';
    $conf['where']['site'] = '[A-Za-z0-9\.\-]+';
}

// if( $conf['prefix'] )
// {
//     Route::get('/', function() use ($params) {
//         return redirect(airoute('aimeos_home', $params));
//     });    
// }

Route::group($conf ?? [], function() {
    require __DIR__.'/auth.php';
});
// prefix: yourdomain.com/vendor1
// Route::group(['prefix' => '{site}', 'middleware' => ['web']], function () {
//     Route::match(['GET', 'POST'], '{path?}', '\Aimeos\Shop\Controller\PageController@indexAction')
//         ->name('aimeos_page')->where( 'path', '.*' )->where( ['site' => '[a-z0-9\-]+'] );
// });


// custom domain: vendor1.com
Route::group(['domain' => '{site}', 'middleware' => ['web']], function () {
    Route::match(['GET', 'POST'], '{path?}', '\Aimeos\Shop\Controller\PageController@indexAction')
        ->name('aimeos_page')->where( 'path', '.*' )->where( ['site' => '[a-z0-9\.\-]+'] );
});
environment: Linux,ubuntu,nginx
PHP version: 8


Post Reply