Skip to content

Commit

Permalink
Make default site code for the admin backend configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Mar 3, 2022
1 parent 1ef39a5 commit 062823a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Aimeos/Shop/Controller/AdminController.php
Expand Up @@ -46,7 +46,7 @@ public function indexAction( \Illuminate\Http\Request $request )
$context = app( 'aimeos.context' )->get( false );
$siteManager = \Aimeos\MShop::create( $context, 'locale/site' );
$siteId = current( array_reverse( explode( '.', trim( $request->user()->siteid, '.' ) ) ) );
$siteCode = ( $siteId ? $siteManager->get( $siteId )->getCode() : 'default' );
$siteCode = ( $siteId ? $siteManager->get( $siteId )->getCode() : config( 'shop.mshop.locale.site', 'default' ) );
$locale = $request->user()->langid ?: config( 'app.locale', 'en' );

$param = array(
Expand Down
3 changes: 3 additions & 0 deletions src/config/shop.php
Expand Up @@ -118,6 +118,9 @@
],

'mshop' => [
'locale' => [
// 'site' => '<custom site code>', // used instead of "default"
]
],


Expand Down

0 comments on commit 062823a

Please sign in to comment.