From 89d943edb923e83b85903542ffdad632af194a34 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 15:01:40 +0200 Subject: [PATCH 01/17] Add functionality to allow removing store code from different store views --- Helper/StoreUrl.php | 46 +++++++++++++++++++ Model/Config.php | 38 ++++++++++++++++ Plugin/Store/HideDefaultStoreCodePlugin.php | 20 ++++++++- etc/acl.xml | 17 +++++++ etc/adminhtml/system.xml | 49 +++++++++++++++++++++ etc/config.xml | 12 +++++ etc/di.xml | 1 + 7 files changed, 182 insertions(+), 1 deletion(-) create mode 100644 Helper/StoreUrl.php create mode 100644 Model/Config.php create mode 100644 etc/acl.xml create mode 100644 etc/adminhtml/system.xml create mode 100644 etc/config.xml diff --git a/Helper/StoreUrl.php b/Helper/StoreUrl.php new file mode 100644 index 0000000..bcf5b02 --- /dev/null +++ b/Helper/StoreUrl.php @@ -0,0 +1,46 @@ +getCode() === Store::ADMIN_CODE) { + return parent::isUseStoreCodeInUrl($store); + } + + /** @var Config $config */ + $config = ObjectManager::getInstance()->get(Config::class); + + if ($config->isPerStoreConfigEnabled()) { + if (in_array((int)$store->getId(), $config->getStoreIdsWithoutStoreCode(), true)) { + return false; + } + } elseif ($store->isDefault()) { + // Default / legacy behaviour: only strip the code for the default store + return false; + } + + $storeId = (int)$store->getId(); + + return !($store->hasDisableStoreInUrl() && $store->getDisableStoreInUrl()) + // @phpstan-ignore-next-line + && $this->configDataLoader->getConfigValue(Store::XML_PATH_STORE_IN_URL, $storeId); + } + } +} else { + class StoreUrl + { + + } +} diff --git a/Model/Config.php b/Model/Config.php new file mode 100644 index 0000000..0a1f877 --- /dev/null +++ b/Model/Config.php @@ -0,0 +1,38 @@ +scopeConfig->isSetFlag(self::XML_PATH_USE_PER_STORE_CONFIG); + } + + /** + * Returns store IDs for which the store code should be removed from the URL. + * + * @return int[] + */ + public function getStoreIdsWithoutStoreCode(): array + { + $value = $this->scopeConfig->getValue(self::XML_PATH_STORES_WITHOUT_STORE_CODE); + + if (empty($value)) { + return []; + } + + return array_map('intval', explode(',', $value)); + } +} diff --git a/Plugin/Store/HideDefaultStoreCodePlugin.php b/Plugin/Store/HideDefaultStoreCodePlugin.php index ad26c57..b61d2a8 100644 --- a/Plugin/Store/HideDefaultStoreCodePlugin.php +++ b/Plugin/Store/HideDefaultStoreCodePlugin.php @@ -4,13 +4,31 @@ namespace CustomGento\DefaultStoreCodeRemover\Plugin\Store; +use CustomGento\DefaultStoreCodeRemover\Model\Config; use Magento\Store\Model\Store; class HideDefaultStoreCodePlugin { + public function __construct(private readonly Config $config) + { + } + public function afterIsUseStoreInUrl(Store $subject, bool $resultIsUseInUrl): bool { - if ($subject->getCode() !== Store::ADMIN_CODE && $subject->isDefault()) { + if ($subject->getCode() === Store::ADMIN_CODE) { + return $resultIsUseInUrl; + } + + if ($this->config->isPerStoreConfigEnabled()) { + if (in_array((int)$subject->getId(), $this->config->getStoreIdsWithoutStoreCode(), true)) { + return false; + } + + return $resultIsUseInUrl; + } + + // Default / legacy behaviour: only strip the code for the default store + if ($subject->isDefault()) { return false; } diff --git a/etc/acl.xml b/etc/acl.xml new file mode 100644 index 0000000..182a100 --- /dev/null +++ b/etc/acl.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml new file mode 100644 index 0000000..b97d43e --- /dev/null +++ b/etc/adminhtml/system.xml @@ -0,0 +1,49 @@ + + + + + + +
+ + customgento + CustomGento_DefaultStoreCodeRemover::config + + + + + No (default): The default store has its store code removed from the URL; all other stores keep it.
+ Yes: You choose individually which stores have their store code removed. + ]]>
+ Magento\Config\Model\Config\Source\Yesno +
+ + + Select every store whose store code should be removed from the URL. + Magento\Config\Model\Config\Source\Store + + 1 + + +
+
+
+
diff --git a/etc/config.xml b/etc/config.xml new file mode 100644 index 0000000..79d2c2d --- /dev/null +++ b/etc/config.xml @@ -0,0 +1,12 @@ + + + + + + + 0 + + + + + diff --git a/etc/di.xml b/etc/di.xml index 44d8874..bd52bd0 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -3,4 +3,5 @@ + From e3981e335aa4501192be616d135120ce2a172d51 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 15:11:57 +0200 Subject: [PATCH 02/17] Add functionality to allow removing store code from different store views --- README.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9f2b74..7680ccb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,17 @@ Default Store Code Remover for Magento 2 hides the store code in the default store from the URL. The module is in effect only when web/url/use_store is enabled and is meant to be used for multistore setups, where the default shop should not contain any store code, whereas all other stores should. +The module also provides an optional, extended configuration to control store code removal **per store view**: + +- Configuration path: **Store > Configuration > CustomGento > Default Store Code Remover** +- Setting: **Configure Store Code Removal Per Store** (Yes/No) + - Default value: **No** (backwards compatible) + - Uses the original behavior: the store code is removed from the **default store view** URL, while all other store views keep their store code in the URL. + - If set to **Yes** + - An additional setting becomes available with a list of **store views**. + - Only the **selected store views** will have the store code removed from the URL. + - All **non-selected store views** will keep the store code in the URL. + ## Installation * composer require customgento/module-default-store-code-remover-m2 @@ -16,13 +27,13 @@ When the store codes in the url are disabled, the URL of the stores looks like t When the store codes in the url are enabled, the URL of the stores looks like this: `https://website.com/store_code/`. When this extension is installed and enabled, and the store codes are enabled to be shown in the url under -Store > Configuration > General > Web >Add Store Code, the module will not show the store code for the default store +Store > Configuration > General > Web >Add Store Code, the module will not show the store code for the default store but will show it for any other store. So, for the default store the url will be `https://website.com/` while for all other store, the URL will be : `https://website.com/store_code` ## License -[OSL - Open Software Licence 3.0](https://opensource.org/licenses/osl-3.0.php) +[OSL - Open Software Licence 3.0](https://opensource.org/licenses/osl--3.0.php) ## Copyright © 2021 - present CustomGento GmbH From 4036d1fae48f3795e3c7fc0a327f4579194e51ab Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 15:31:26 +0200 Subject: [PATCH 03/17] Add functionality to allow removing store code from different store views --- Helper/StoreUrl.php | 46 ---------------------------------------- Model/Config.php | 4 ++-- etc/adminhtml/system.xml | 24 +++++++-------------- etc/config.xml | 9 ++++---- 4 files changed, 14 insertions(+), 69 deletions(-) delete mode 100644 Helper/StoreUrl.php diff --git a/Helper/StoreUrl.php b/Helper/StoreUrl.php deleted file mode 100644 index bcf5b02..0000000 --- a/Helper/StoreUrl.php +++ /dev/null @@ -1,46 +0,0 @@ -getCode() === Store::ADMIN_CODE) { - return parent::isUseStoreCodeInUrl($store); - } - - /** @var Config $config */ - $config = ObjectManager::getInstance()->get(Config::class); - - if ($config->isPerStoreConfigEnabled()) { - if (in_array((int)$store->getId(), $config->getStoreIdsWithoutStoreCode(), true)) { - return false; - } - } elseif ($store->isDefault()) { - // Default / legacy behaviour: only strip the code for the default store - return false; - } - - $storeId = (int)$store->getId(); - - return !($store->hasDisableStoreInUrl() && $store->getDisableStoreInUrl()) - // @phpstan-ignore-next-line - && $this->configDataLoader->getConfigValue(Store::XML_PATH_STORE_IN_URL, $storeId); - } - } -} else { - class StoreUrl - { - - } -} diff --git a/Model/Config.php b/Model/Config.php index 0a1f877..f899997 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -8,8 +8,8 @@ class Config { - public const XML_PATH_USE_PER_STORE_CONFIG = 'customgento_default_store_code_remover/general/use_per_store_config'; - public const XML_PATH_STORES_WITHOUT_STORE_CODE = 'customgento_default_store_code_remover/general/stores_without_store_code'; + public const XML_PATH_USE_PER_STORE_CONFIG = 'web/url/use_per_store_config'; + public const XML_PATH_STORES_WITHOUT_STORE_CODE = 'web/url/stores_without_store_code'; public function __construct(private readonly ScopeConfigInterface $scopeConfig) { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index b97d43e..1536bc6 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,24 +1,12 @@ - - - -
- - customgento - CustomGento_DefaultStoreCodeRemover::config - - +
+ @@ -28,11 +16,14 @@ Yes: You choose individually which stores have their store code removed. ]]> Magento\Config\Model\Config\Source\Yesno + + 1 + @@ -40,6 +31,7 @@ Select every store whose store code should be removed from the URL. Magento\Config\Model\Config\Source\Store + 1 1 diff --git a/etc/config.xml b/etc/config.xml index 79d2c2d..9f082fd 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -1,12 +1,11 @@ - - - + + 0 - - + + From d17a07b6f865938415116a3fcd63ade4a754debc Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 15:33:04 +0200 Subject: [PATCH 04/17] Add functionality to allow removing store code from different store views --- etc/di.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/etc/di.xml b/etc/di.xml index bd52bd0..44d8874 100644 --- a/etc/di.xml +++ b/etc/di.xml @@ -3,5 +3,4 @@ - From cc2b2377974a64d28d20a0bc6afc6e7d6e550951 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 16:36:48 +0200 Subject: [PATCH 05/17] Change integration yml file --- .github/workflows/integration.yml | 408 +++++++++++++++++++++++++++++- 1 file changed, 401 insertions(+), 7 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8c58bb0..cd725ad 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,9 +1,403 @@ -name: ExtDN M2 Integration -on: [push, pull_request] +name: ExtDN M2 Integration Tests +on: + workflow_call: + inputs: + module_name: + description: "Module name" + required: true + type: string + composer_name: + description: "Composer name" + required: true + type: string jobs: - integration: - uses: customgento/m2-github-actions/.github/workflows/integration.yml@main - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 + integration-tests-2-4-6-p13-8-1: + name: Magento 2.4.6-p13 PHP 8.1 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.1) + uses: extdn/github-actions-m2/magento-integration-tests/8.1@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.6-p13" + composer_version: "2" + + integration-tests-2-4-6-p13-8-2: + name: Magento 2.4.6-p13 PHP 8.2 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.2) + uses: extdn/github-actions-m2/magento-integration-tests/8.2@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.6-p13" + composer_version: "2" + + integration-tests-2-4-6-p14-8-1: + name: Magento 2.4.6-p14 PHP 8.1 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.1) + uses: extdn/github-actions-m2/magento-integration-tests/8.1@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.6-p14" + composer_version: "2" + + integration-tests-2-4-6-p14-8-2: + name: Magento 2.4.6-p14 PHP 8.2 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.2) + uses: extdn/github-actions-m2/magento-integration-tests/8.2@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.6-p14" + composer_version: "2" + + integration-tests-2-4-7-p4-8-1: + name: Magento 2.4.7-p4 PHP 8.1 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.1) + uses: extdn/github-actions-m2/magento-integration-tests/8.1@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p4" + composer_version: "2" + + integration-tests-2-4-7-p4-8-2: + name: Magento 2.4.7-p4 PHP 8.2 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.2) + uses: extdn/github-actions-m2/magento-integration-tests/8.2@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p4" + composer_version: "2" + + integration-tests-2-4-7-p4-8-3: + name: Magento 2.4.7-p4 PHP 8.3 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.3) + uses: extdn/github-actions-m2/magento-integration-tests/8.3@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p4" + composer_version: "2" + + integration-tests-2-4-7-p5-8-1: + name: Magento 2.4.7-p5 PHP 8.1 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.1) + uses: extdn/github-actions-m2/magento-integration-tests/8.1@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p5" + composer_version: "2" + + integration-tests-2-4-7-p5-8-2: + name: Magento 2.4.7-p5 PHP 8.2 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.2) + uses: extdn/github-actions-m2/magento-integration-tests/8.2@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p5" + composer_version: "2" + + integration-tests-2-4-7-p5-8-3: + name: Magento 2.4.7-p5 PHP 8.3 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:7.8 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.3) + uses: extdn/github-actions-m2/magento-integration-tests/8.3@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.7-p5" + composer_version: "2" + + integration-tests-2-4-8-8-2: + name: Magento 2.4.8 PHP 8.2 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:8.1 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.2) + uses: extdn/github-actions-m2/magento-integration-tests/8.2@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.8" + composer_version: "2" + + integration-tests-2-4-8-8-3: + name: Magento 2.4.8 PHP 8.3 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:8.1 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.3) + uses: extdn/github-actions-m2/magento-integration-tests/8.3@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.8" + composer_version: "2" + + integration-tests-2-4-8-8-4: + name: Magento 2.4.8 PHP 8.4 Integration Tests + runs-on: ubuntu-latest + services: + mysql: + image: mysql:5.7 + env: + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + es: + image: docker.io/wardenenv/elasticsearch:8.1 + ports: + - 9200:9200 + env: + "discovery.type": single-node + "xpack.security.enabled": false + ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: + - uses: actions/checkout@v4 + - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.4) + uses: extdn/github-actions-m2/magento-integration-tests/8.4@master + with: + module_name: ${{ inputs.module_name }} + composer_name: ${{ inputs.composer_name }} + magento_version: "2.4.8" + composer_version: "2" From 3f5eb9d6fd3feca4e2c8a236945032b021cdef90 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Wed, 22 Apr 2026 16:42:14 +0200 Subject: [PATCH 06/17] Change yml file --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index cd725ad..7c2be3a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,5 +1,5 @@ name: ExtDN M2 Integration Tests -on: +on: [push, pull_request] workflow_call: inputs: module_name: From deb2c4e97fb72db67fb1d27d8a0e544f0edbb778 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 09:35:44 +0200 Subject: [PATCH 07/17] Change integration yml file --- .github/workflows/integration.yml | 58 +++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 7c2be3a..59d4662 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -37,8 +37,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.1) uses: extdn/github-actions-m2/magento-integration-tests/8.1@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.6-p13" composer_version: "2" @@ -67,8 +67,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.2) uses: extdn/github-actions-m2/magento-integration-tests/8.2@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.6-p13" composer_version: "2" @@ -97,8 +97,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.1) uses: extdn/github-actions-m2/magento-integration-tests/8.1@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.6-p14" composer_version: "2" @@ -127,8 +127,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.2) uses: extdn/github-actions-m2/magento-integration-tests/8.2@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.6-p14" composer_version: "2" @@ -157,8 +157,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.1) uses: extdn/github-actions-m2/magento-integration-tests/8.1@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p4" composer_version: "2" @@ -187,8 +187,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.2) uses: extdn/github-actions-m2/magento-integration-tests/8.2@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p4" composer_version: "2" @@ -217,8 +217,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.3) uses: extdn/github-actions-m2/magento-integration-tests/8.3@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p4" composer_version: "2" @@ -247,8 +247,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.1) uses: extdn/github-actions-m2/magento-integration-tests/8.1@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p5" composer_version: "2" @@ -277,8 +277,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.2) uses: extdn/github-actions-m2/magento-integration-tests/8.2@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p5" composer_version: "2" @@ -307,8 +307,8 @@ jobs: - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.3) uses: extdn/github-actions-m2/magento-integration-tests/8.3@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.7-p5" composer_version: "2" @@ -330,15 +330,15 @@ jobs: env: "discovery.type": single-node "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + ES_JAVA_OPTS: "-Xms64m -Xmx512m" options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v4 - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.2) uses: extdn/github-actions-m2/magento-integration-tests/8.2@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.8" composer_version: "2" @@ -360,15 +360,15 @@ jobs: env: "discovery.type": single-node "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + ES_JAVA_OPTS: "-Xms64m -Xmx512m" options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v4 - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.3) uses: extdn/github-actions-m2/magento-integration-tests/8.3@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.8" composer_version: "2" @@ -390,14 +390,14 @@ jobs: env: "discovery.type": single-node "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m -XX:-UseContainerSupport" + ES_JAVA_OPTS: "-Xms64m -Xmx512m" options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - uses: actions/checkout@v4 - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.4) uses: extdn/github-actions-m2/magento-integration-tests/8.4@master with: - module_name: ${{ inputs.module_name }} - composer_name: ${{ inputs.composer_name }} + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 magento_version: "2.4.8" composer_version: "2" From ad220f82ef75837a5910a18e13fa8a48c52a95d7 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 09:53:24 +0200 Subject: [PATCH 08/17] Change integration yml file --- .github/workflows/integration.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 59d4662..94cabac 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,15 +1,5 @@ name: ExtDN M2 Integration Tests on: [push, pull_request] - workflow_call: - inputs: - module_name: - description: "Module name" - required: true - type: string - composer_name: - description: "Composer name" - required: true - type: string jobs: integration-tests-2-4-6-p13-8-1: From d08f8d26eb202a954de875a07f5022ce1a7b480f Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 10:07:51 +0200 Subject: [PATCH 09/17] Change integration yml file --- .github/workflows/integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 94cabac..5903a3a 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -304,7 +304,7 @@ jobs: integration-tests-2-4-8-8-2: name: Magento 2.4.8 PHP 8.2 Integration Tests - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: mysql: image: mysql:5.7 @@ -334,7 +334,7 @@ jobs: integration-tests-2-4-8-8-3: name: Magento 2.4.8 PHP 8.3 Integration Tests - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: mysql: image: mysql:5.7 @@ -364,7 +364,7 @@ jobs: integration-tests-2-4-8-8-4: name: Magento 2.4.8 PHP 8.4 Integration Tests - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 services: mysql: image: mysql:5.7 From 0eb6a5032072d7335b90ff56e2c3d377595233e8 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 10:21:39 +0200 Subject: [PATCH 10/17] Change integration yml file --- .github/workflows/integration.yml | 396 +----------------------------- 1 file changed, 6 insertions(+), 390 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 5903a3a..898c13d 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -1,393 +1,9 @@ -name: ExtDN M2 Integration Tests +name: ExtDN M2 Integration on: [push, pull_request] jobs: - integration-tests-2-4-6-p13-8-1: - name: Magento 2.4.6-p13 PHP 8.1 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.1) - uses: extdn/github-actions-m2/magento-integration-tests/8.1@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.6-p13" - composer_version: "2" - - integration-tests-2-4-6-p13-8-2: - name: Magento 2.4.6-p13 PHP 8.2 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.6-p13 (PHP 8.2) - uses: extdn/github-actions-m2/magento-integration-tests/8.2@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.6-p13" - composer_version: "2" - - integration-tests-2-4-6-p14-8-1: - name: Magento 2.4.6-p14 PHP 8.1 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.1) - uses: extdn/github-actions-m2/magento-integration-tests/8.1@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.6-p14" - composer_version: "2" - - integration-tests-2-4-6-p14-8-2: - name: Magento 2.4.6-p14 PHP 8.2 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.6-p14 (PHP 8.2) - uses: extdn/github-actions-m2/magento-integration-tests/8.2@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.6-p14" - composer_version: "2" - - integration-tests-2-4-7-p4-8-1: - name: Magento 2.4.7-p4 PHP 8.1 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.1) - uses: extdn/github-actions-m2/magento-integration-tests/8.1@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p4" - composer_version: "2" - - integration-tests-2-4-7-p4-8-2: - name: Magento 2.4.7-p4 PHP 8.2 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.2) - uses: extdn/github-actions-m2/magento-integration-tests/8.2@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p4" - composer_version: "2" - - integration-tests-2-4-7-p4-8-3: - name: Magento 2.4.7-p4 PHP 8.3 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p4 (PHP 8.3) - uses: extdn/github-actions-m2/magento-integration-tests/8.3@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p4" - composer_version: "2" - - integration-tests-2-4-7-p5-8-1: - name: Magento 2.4.7-p5 PHP 8.1 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.1) - uses: extdn/github-actions-m2/magento-integration-tests/8.1@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p5" - composer_version: "2" - - integration-tests-2-4-7-p5-8-2: - name: Magento 2.4.7-p5 PHP 8.2 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.2) - uses: extdn/github-actions-m2/magento-integration-tests/8.2@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p5" - composer_version: "2" - - integration-tests-2-4-7-p5-8-3: - name: Magento 2.4.7-p5 PHP 8.3 Integration Tests - runs-on: ubuntu-latest - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:7.8 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.7-p5 (PHP 8.3) - uses: extdn/github-actions-m2/magento-integration-tests/8.3@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.7-p5" - composer_version: "2" - - integration-tests-2-4-8-8-2: - name: Magento 2.4.8 PHP 8.2 Integration Tests - runs-on: ubuntu-22.04 - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:8.1 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.2) - uses: extdn/github-actions-m2/magento-integration-tests/8.2@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.8" - composer_version: "2" - - integration-tests-2-4-8-8-3: - name: Magento 2.4.8 PHP 8.3 Integration Tests - runs-on: ubuntu-22.04 - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:8.1 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.3) - uses: extdn/github-actions-m2/magento-integration-tests/8.3@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.8" - composer_version: "2" - - integration-tests-2-4-8-8-4: - name: Magento 2.4.8 PHP 8.4 Integration Tests - runs-on: ubuntu-22.04 - services: - mysql: - image: mysql:5.7 - env: - MYSQL_ROOT_PASSWORD: root - ports: - - 3306:3306 - options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - es: - image: docker.io/wardenenv/elasticsearch:8.1 - ports: - - 9200:9200 - env: - "discovery.type": single-node - "xpack.security.enabled": false - ES_JAVA_OPTS: "-Xms64m -Xmx512m" - options: --health-cmd="curl localhost:9200/_cluster/health?wait_for_status=yellow&timeout=60s" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v4 - - name: M2 Integration Tests with Magento 2 Version 2.4.8 (PHP 8.4) - uses: extdn/github-actions-m2/magento-integration-tests/8.4@master - with: - module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 - magento_version: "2.4.8" - composer_version: "2" + integration: + uses: customgento/m2-github-actions/.github/workflows/integration.yml@main + with: + module_name: CustomGento_DefaultStoreCodeRemover + composer_name: customgento/module-default-store-code-remover-m2 \ No newline at end of file From 9d219bed9fcfa43b292ed5892628ee609a2d17d9 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 10:26:27 +0200 Subject: [PATCH 11/17] Change integration yml file --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 898c13d..8c58bb0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -6,4 +6,4 @@ jobs: uses: customgento/m2-github-actions/.github/workflows/integration.yml@main with: module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 \ No newline at end of file + composer_name: customgento/module-default-store-code-remover-m2 From 2fa54a5949d2abbdb5e5abc5e1e6eaddc0699043 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 11:58:28 +0200 Subject: [PATCH 12/17] Change integration yml file --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8c58bb0..9f617a7 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -6,4 +6,4 @@ jobs: uses: customgento/m2-github-actions/.github/workflows/integration.yml@main with: module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m2 + composer_name: customgento/module-default-store-code-remover-m3 From 99b4271996d4f9e578c1869478a9df8db114d678 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 11:58:37 +0200 Subject: [PATCH 13/17] Change integration yml file --- .github/workflows/integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9f617a7..8c58bb0 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -6,4 +6,4 @@ jobs: uses: customgento/m2-github-actions/.github/workflows/integration.yml@main with: module_name: CustomGento_DefaultStoreCodeRemover - composer_name: customgento/module-default-store-code-remover-m3 + composer_name: customgento/module-default-store-code-remover-m2 From 8d4a577cfb9fc6a73015f6dedecc03080bb38f59 Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Thu, 23 Apr 2026 14:46:18 +0200 Subject: [PATCH 14/17] PR changes --- Model/Config.php | 5 ----- Plugin/Store/HideDefaultStoreCodePlugin.php | 7 ++----- README.md | 2 +- composer.json | 2 +- etc/adminhtml/system.xml | 4 ++-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/Model/Config.php b/Model/Config.php index f899997..ba74a87 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -20,11 +20,6 @@ public function isPerStoreConfigEnabled(): bool return $this->scopeConfig->isSetFlag(self::XML_PATH_USE_PER_STORE_CONFIG); } - /** - * Returns store IDs for which the store code should be removed from the URL. - * - * @return int[] - */ public function getStoreIdsWithoutStoreCode(): array { $value = $this->scopeConfig->getValue(self::XML_PATH_STORES_WITHOUT_STORE_CODE); diff --git a/Plugin/Store/HideDefaultStoreCodePlugin.php b/Plugin/Store/HideDefaultStoreCodePlugin.php index b61d2a8..aefe323 100644 --- a/Plugin/Store/HideDefaultStoreCodePlugin.php +++ b/Plugin/Store/HideDefaultStoreCodePlugin.php @@ -20,11 +20,8 @@ public function afterIsUseStoreInUrl(Store $subject, bool $resultIsUseInUrl): bo } if ($this->config->isPerStoreConfigEnabled()) { - if (in_array((int)$subject->getId(), $this->config->getStoreIdsWithoutStoreCode(), true)) { - return false; - } - - return $resultIsUseInUrl; + return !in_array((int)$subject->getId(), $this->config->getStoreIdsWithoutStoreCode(), true) + && $resultIsUseInUrl; } // Default / legacy behaviour: only strip the code for the default store diff --git a/README.md b/README.md index 7680ccb..721d548 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Default Store Code Remover for Magento 2 hides the store code in the default sto The module also provides an optional, extended configuration to control store code removal **per store view**: -- Configuration path: **Store > Configuration > CustomGento > Default Store Code Remover** +- Configuration path: **Store > Configuration > Genral > Web** - Setting: **Configure Store Code Removal Per Store** (Yes/No) - Default value: **No** (backwards compatible) - Uses the original behavior: the store code is removed from the **default store view** URL, while all other store views keep their store code in the URL. diff --git a/composer.json b/composer.json index 4e52d6c..c72ab3e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "~7.3.0||~7.4.0||~8.1.0||~8.2.0||~8.3.0||~8.4.0", + "php": "~8.1.0||~8.2.0||~8.3.0||~8.4.0", "magento/module-store": "~101.0" }, "suggest": { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 1536bc6..818beca 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,8 +1,8 @@ -
- +
+ Date: Thu, 23 Apr 2026 14:48:03 +0200 Subject: [PATCH 15/17] PR changes --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index c72ab3e..b964c02 100644 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "name": "customgento/module-default-store-code-remover-m2", "description": "Default Store Code Remover for Magento 2 hides the store code in the default store from the URL.", "type": "magento2-module", + "version":"1.0.0", "license": "OSL-3.0", "authors": [ { From 05759097ad5adfca2ecf9e3bc949298b8fdd69ba Mon Sep 17 00:00:00 2001 From: norgeindian Date: Fri, 24 Apr 2026 09:31:27 +0200 Subject: [PATCH 16/17] Improve smaller things,DEV-1790 --- composer.json | 2 +- etc/acl.xml | 17 ----------------- etc/adminhtml/system.xml | 22 ++++------------------ 3 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 etc/acl.xml diff --git a/composer.json b/composer.json index b964c02..354e10c 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "customgento/module-default-store-code-remover-m2", "description": "Default Store Code Remover for Magento 2 hides the store code in the default store from the URL.", "type": "magento2-module", - "version":"1.0.0", + "version":"3.0.0", "license": "OSL-3.0", "authors": [ { diff --git a/etc/acl.xml b/etc/acl.xml deleted file mode 100644 index 182a100..0000000 --- a/etc/acl.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 818beca..1fa44bb 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -3,30 +3,16 @@
- + - No (default): The default store has its store code removed from the URL; all other stores keep it.
- Yes: You choose individually which stores have their store code removed. - ]]>
+ No (default): The default store has its store code removed from the URL; all other stores keep it.
+ Yes: You choose individually which stores have their store code removed.]]>
Magento\Config\Model\Config\Source\Yesno 1
- + Select every store whose store code should be removed from the URL. Magento\Config\Model\Config\Source\Store From 02970d1ecf4f8fae5b6bc6a32c2bde134e6006bf Mon Sep 17 00:00:00 2001 From: Kapil Pandya Date: Fri, 24 Apr 2026 11:00:34 +0200 Subject: [PATCH 17/17] Make PR Changes --- Plugin/Store/HideDefaultStoreCodePlugin.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Plugin/Store/HideDefaultStoreCodePlugin.php b/Plugin/Store/HideDefaultStoreCodePlugin.php index aefe323..1606097 100644 --- a/Plugin/Store/HideDefaultStoreCodePlugin.php +++ b/Plugin/Store/HideDefaultStoreCodePlugin.php @@ -13,15 +13,18 @@ public function __construct(private readonly Config $config) { } - public function afterIsUseStoreInUrl(Store $subject, bool $resultIsUseInUrl): bool + public function afterIsUseStoreInUrl(Store $subject, bool $storeCodeShallBeIncludedInUrl): bool { + if (!$storeCodeShallBeIncludedInUrl) { + return $storeCodeShallBeIncludedInUrl; + } + if ($subject->getCode() === Store::ADMIN_CODE) { - return $resultIsUseInUrl; + return $storeCodeShallBeIncludedInUrl; } if ($this->config->isPerStoreConfigEnabled()) { - return !in_array((int)$subject->getId(), $this->config->getStoreIdsWithoutStoreCode(), true) - && $resultIsUseInUrl; + return !in_array((int)$subject->getId(), $this->config->getStoreIdsWithoutStoreCode(), true); } // Default / legacy behaviour: only strip the code for the default store @@ -29,6 +32,6 @@ public function afterIsUseStoreInUrl(Store $subject, bool $resultIsUseInUrl): bo return false; } - return $resultIsUseInUrl; + return $storeCodeShallBeIncludedInUrl; } }