File tree Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Expand file tree Collapse file tree 2 files changed +18
-11
lines changed Original file line number Diff line number Diff line change 8
8
use Magento \Store \Model \Store ;
9
9
use MageWorx \SeoBase \Helper \StoreUrl as MageworxStoreUrl ;
10
10
11
- class StoreUrl extends MageworxStoreUrl
12
- {
13
- protected function isUseStoreCodeInUrl (StoreInterface $ store ): bool
11
+ if (class_exists (MageworxStoreUrl::class)) {
12
+ class StoreUrl extends MageworxStoreUrl
14
13
{
15
- if ($ store ->getCode () !== Store::ADMIN_CODE && $ store ->isDefault ()) {
16
- return false ;
17
- }
14
+ protected function isUseStoreCodeInUrl (StoreInterface $ store ): bool
15
+ {
16
+ if ($ store ->getCode () !== Store::ADMIN_CODE && $ store ->isDefault ()) {
17
+ return false ;
18
+ }
19
+
20
+ $ storeId = (int )$ store ->getId ();
18
21
19
- $ storeId = (int )$ store ->getId ();
22
+ return !($ store ->hasDisableStoreInUrl () && $ store ->getDisableStoreInUrl ())
23
+ // @phpstan-ignore-next-line
24
+ && $ this ->configDataLoader ->getConfigValue (Store::XML_PATH_STORE_IN_URL , $ storeId );
25
+ }
26
+ }
27
+ } else {
28
+ class StoreUrl
29
+ {
20
30
21
- return !($ store ->hasDisableStoreInUrl () && $ store ->getDisableStoreInUrl ())
22
- && $ this ->configDataLoader ->getConfigValue (Store::XML_PATH_STORE_IN_URL , $ storeId );
23
31
}
24
32
}
Original file line number Diff line number Diff line change 3
3
<type name =" Magento\Store\Model\Store" >
4
4
<plugin name =" hide_default_store_code" type =" CustomGento\DefaultStoreCodeRemover\Plugin\Store\HideDefaultStoreCodePlugin" />
5
5
</type >
6
-
7
6
<preference for =" MageWorx\SeoBase\Helper\StoreUrl" type =" CustomGento\DefaultStoreCodeRemover\Helper\StoreUrl" />
8
- </config >
7
+ </config >
You can’t perform that action at this time.
0 commit comments