Skip to content

Commit 6fcd3ce

Browse files
authored
Merge pull request #1 from customgento/DEV-1323-initialize-module
Initialize project, DEV-1323
2 parents de666ba + 476372e commit 6fcd3ce

File tree

9 files changed

+103
-0
lines changed

9 files changed

+103
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [customgento]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: ExtDN M2 Coding Standard
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpcs:
6+
uses: customgento/m2-github-actions/.github/workflows/coding-standard.yml@main
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: ExtDN M2 Mess Detector
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpmd:
6+
uses: customgento/m2-github-actions/.github/workflows/mess-detector.yml@main

Helper/StoreUrl.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace CustomGento\DefaultStoreCodeRemoverMageworxCompat\Helper;
6+
7+
use Magento\Store\Api\Data\StoreInterface;
8+
use Magento\Store\Model\Store;
9+
use MageWorx\SeoBase\Helper\StoreUrl as MageworxStoreUrl;
10+
11+
class StoreUrl extends MageworxStoreUrl
12+
{
13+
protected function isUseStoreCodeInUrl(StoreInterface $store): bool
14+
{
15+
if ($store->getCode() !== Store::ADMIN_CODE && $store->isDefault()) {
16+
return false;
17+
}
18+
19+
$storeId = (int)$store->getId();
20+
21+
return !($store->hasDisableStoreInUrl() && $store->getDisableStoreInUrl())
22+
&& $this->configDataLoader->getConfigValue(Store::XML_PATH_STORE_IN_URL, $storeId);
23+
}
24+
}

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Module Default Store Code Remover M2 - MageWorx Compatibility
2+
This module is an extension of the Default Store Code Remover M2 module, specifically designed to ensure compatibility with MageWorx extensions. It removes the default store code from URLs while maintaining full functionality of MageWorx features.
3+
4+
## Features
5+
- Ensures compatibility with MageWorx extensions, allowing them to function seamlessly without any disruptions
6+
7+
## Installation
8+
* <code>composer require customgento/module-default-store-code-remover-m2-mageworx-compatibility</code>
9+
* <code>bin/magento module:enable CustomGento_DefaultStoreCodeRemoverMageworxCompatibility</code>
10+
* <code>bin/magento setup:upgrade</code>
11+
* <code>bin/magento cache:flush</code>
12+
* <code>bin/magento setup:di:compile</code>
13+
14+
## License
15+
[OSL - Open Software Licence 3.0](https://opensource.org/licenses/osl-3.0.php)
16+
17+
## Copyright
18+
&copy; 2025 - present CustomGento GmbH

composer.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "customgento/module-default-store-code-remover-m2-mageworx-compatibility",
3+
"description": "Magento 2 module to remove default store code from URLs - MageWorx compatibility",
4+
"type": "magento2-module",
5+
"license": "OSL-3.0",
6+
"authors": [
7+
{
8+
"name": "Team CustomGento",
9+
"email": "info@customgento.com"
10+
}
11+
],
12+
"require": {
13+
"customgento/module-default-store-code-remover-m2": "^2.0",
14+
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0||~8.4.0",
15+
"magento/module-store": "~101.0",
16+
"mageworx/module-seobase": "^2.13"
17+
},
18+
"autoload": {
19+
"files": [
20+
"registration.php"
21+
],
22+
"psr-4": {
23+
"CustomGento\\DefaultStoreCodeRemoverMageworxCompat\\": ""
24+
}
25+
}
26+
}

etc/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
3+
<preference for="MageWorx\SeoBase\Helper\StoreUrl" type="CustomGento\DefaultStoreCodeRemoverMageworxCompat\Helper\StoreUrl"/>
4+
</config>

etc/module.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3+
<module name="CustomGento_DefaultStoreCodeRemoverMageworxCompatibility">
4+
<sequence>
5+
<module name="CustomGento_DefaultStoreCodeRemover"/>
6+
<module name="Magento_Store"/>
7+
<module name="MageWorx_SeoBase"/>
8+
</sequence>
9+
</module>
10+
</config>

registration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Magento\Framework\Component\ComponentRegistrar;
6+
7+
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'CustomGento_DefaultStoreCodeRemoverMageworxCompatibility',
8+
__DIR__);

0 commit comments

Comments
 (0)