Changing root site code from default breaks parts of site
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Changing root site code from default breaks parts of site
Hi.
Customer wants the url to be <domain>/marketplace/<category/product etc>
So I've changed the shop domain in admin configuration -> settings from default to marketplace
Then I've removed the /shop in shop.php for default prefix :
Most of the things now works as they should, but if I go to <domain>/ i get a fatal error "locale missing"
I've traced this to the https://github.com/aimeos/aimeos-larave ... hp#L57-L66 and the View.php in the same folder where the locale is hard-defaulted to "default" if locale is null.
Is there a way to override/control this in my extension?
Thanx/Dan
Customer wants the url to be <domain>/marketplace/<category/product etc>
So I've changed the shop domain in admin configuration -> settings from default to marketplace
Then I've removed the /shop in shop.php for default prefix :
Code: Select all
'default' => ['prefix' => '{site}/', 'middleware' => ['web']],
I've traced this to the https://github.com/aimeos/aimeos-larave ... hp#L57-L66 and the View.php in the same folder where the locale is hard-defaulted to "default" if locale is null.
Is there a way to override/control this in my extension?
Thanx/Dan
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Changing root site code from default breaks parts of site
Your site setup doesn't seem to be correct.
If you want custom domains for vendor sites, your configuration in your config/shop.php must look like:
For more information have a look at:
https://aimeos.org/docs/latest/laravel/ ... he-routing
If you want custom domains for vendor sites, your configuration in your config/shop.php must look like:
Code: Select all
'routes' => [
'admin' => ['domain' => '{site}', 'prefix' => 'admin', 'middleware' => ['web']],
'jqadm' => ['domain' => '{site}', 'prefix' => 'admin/jqadm', 'middleware' => ['web', 'auth']],
'jsonadm' => ['domain' => '{site}', 'prefix' => 'admin/jsonadm', 'middleware' => ['web', 'auth']],
'jsonapi' => ['domain' => '{site}', 'prefix' => 'jsonapi', 'middleware' => ['web', 'api']],
'account' => ['domain' => '{site}', 'prefix' => 'profile', 'middleware' => ['web', 'auth']],
'default' => ['domain' => '{site}', 'prefix' => 'shop', 'middleware' => ['web']],
'update' => ['domain' => '{site}'],
],
https://aimeos.org/docs/latest/laravel/ ... he-routing
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Changing root site code from default breaks parts of site
Might have been unclear here.
I have one domain, that's the same for all. I don't want separate domains for the vendor sites.
I'm using the marketplace extension, so all "sub-sites" have their own name/site-code, but the parent site sitecode is named "default" in the original installation. So the standard url to the shop where I can shop from all sub-sites/vendors becomes https://mycustomersshop.com/default/shop/
What I'd like the overall url to be is: https://mycustomersshop.com/marketplace/shop/
That's why I want to change the site-code "default" to marketplace, but in the https://github.com/aimeos/aimeos-larave ... hp#L57-L66 the locale hard coded to "default" if it's null.
/Dan
I have one domain, that's the same for all. I don't want separate domains for the vendor sites.
I'm using the marketplace extension, so all "sub-sites" have their own name/site-code, but the parent site sitecode is named "default" in the original installation. So the standard url to the shop where I can shop from all sub-sites/vendors becomes https://mycustomersshop.com/default/shop/
What I'd like the overall url to be is: https://mycustomersshop.com/marketplace/shop/
That's why I want to change the site-code "default" to marketplace, but in the https://github.com/aimeos/aimeos-larave ... hp#L57-L66 the locale hard coded to "default" if it's null.
/Dan
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Changing root site code from default breaks parts of site
It's correct that there's a fallback to "default" if no site ID is available in the URL. It should be no problem to make that configurable, so this has been changed in dev-master and 2021.10.x-dev:
https://github.com/aimeos/aimeos-larave ... 81bf3b5cca
Install 2021.10.x-dev first:
Then, adapt the default site code in your config/shop.php using:
https://github.com/aimeos/aimeos-larave ... 81bf3b5cca
Install 2021.10.x-dev first:
Code: Select all
composer req aimeos/aimeos-laravel:2021.10.x-dev
Code: Select all
'site_default' => 'marketplace'
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Changing root site code from default breaks parts of site
Great!
Thank you, that was pretty much the solution I was thinking of, but didn't want to do in core files
A merry Christmas and a happy new year to you all!
Thank you, that was pretty much the solution I was thinking of, but didn't want to do in core files
A merry Christmas and a happy new year to you all!
_____________
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Laravel 8 with Aimeos 2021.10.7 + Marketplace. Setup via composer. Mac with Valet and MySql 8.0.25
Re: Changing root site code from default breaks parts of site
We've renamed the config to:
Reason is that it's now the same configuration as we use in other integrations.
Code: Select all
'mshop' => [
'locale' => [
'site' => 'marketplace'
]
]
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star