Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [customgento]
6 changes: 6 additions & 0 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: ExtDN M2 Coding Standard
on: [push, pull_request]

jobs:
phpcs:
uses: customgento/m2-github-actions/.github/workflows/coding-standard.yml@main
6 changes: 6 additions & 0 deletions .github/workflows/mess-detector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: ExtDN M2 Mess Detector
on: [push, pull_request]

jobs:
phpmd:
uses: customgento/m2-github-actions/.github/workflows/mess-detector.yml@main
24 changes: 24 additions & 0 deletions Helper/StoreUrl.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

declare(strict_types=1);

namespace CustomGento\DefaultStoreCodeRemoverMageworxCompat\Helper;

use Magento\Store\Api\Data\StoreInterface;
use Magento\Store\Model\Store;
use MageWorx\SeoBase\Helper\StoreUrl as MageworxStoreUrl;

class StoreUrl extends MageworxStoreUrl
{
protected function isUseStoreCodeInUrl(StoreInterface $store): bool
{
if ($store->getCode() !== Store::ADMIN_CODE && $store->isDefault()) {
return false;
}

$storeId = (int)$store->getId();

return !($store->hasDisableStoreInUrl() && $store->getDisableStoreInUrl())
&& $this->configDataLoader->getConfigValue(Store::XML_PATH_STORE_IN_URL, $storeId);
}
}
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Module Default Store Code Remover M2 - MageWorx Compatibility
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.

## Features
- Ensures compatibility with MageWorx extensions, allowing them to function seamlessly without any disruptions

## Installation
* <code>composer require customgento/module-default-store-code-remover-m2-mageworx-compatibility</code>
* <code>bin/magento module:enable CustomGento_DefaultStoreCodeRemoverMageworxCompatibility</code>
* <code>bin/magento setup:upgrade</code>
* <code>bin/magento cache:flush</code>
* <code>bin/magento setup:di:compile</code>

## License
[OSL - Open Software Licence 3.0](https://opensource.org/licenses/osl-3.0.php)

## Copyright
&copy; 2021 - present CustomGento GmbH
26 changes: 26 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "customgento/module-default-store-code-remover-m2-mageworx-compatibility",
"description": "Magento 2 module to remove default store code from URLs - MageWorx compatibility",
"type": "magento2-module",
"license": "OSL-3.0",
"authors": [
{
"name": "Team CustomGento",
"email": "info@customgento.com"
}
],
"require": {
"customgento/module-default-store-code-remover-m2": "^1.0||dev-master",
"php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0||~8.4.0",
"magento/module-store": "~101.0",
"mageworx/module-seobase": "^2.13"
},
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"CustomGento\\DefaultStoreCodeRemoverMageworxCompat\\": ""
}
}
}
4 changes: 4 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MageWorx\SeoBase\Helper\StoreUrl" type="CustomGento\DefaultStoreCodeRemoverMageworxCompat\Helper\StoreUrl"/>
</config>
10 changes: 10 additions & 0 deletions etc/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="CustomGento_DefaultStoreCodeRemoverMageworxCompatibility">
<sequence>
<module name="CustomGento_DefaultStoreCodeRemover"/>
<module name="Magento_Store"/>
<module name="MageWorx_SeoBase"/>
</sequence>
</module>
</config>
8 changes: 8 additions & 0 deletions registration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

declare(strict_types=1);

use Magento\Framework\Component\ComponentRegistrar;

ComponentRegistrar::register(ComponentRegistrar::MODULE, 'CustomGento_DefaultStoreCodeRemoverMageworxCompatibility',
__DIR__);