-
-
Notifications
You must be signed in to change notification settings - Fork 6
Remove store code from URL for different store views, DEV-1790 #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
89d943e
Add functionality to allow removing store code from different store v…
kapilpandya22 e3981e3
Add functionality to allow removing store code from different store v…
kapilpandya22 4036d1f
Add functionality to allow removing store code from different store v…
kapilpandya22 d17a07b
Add functionality to allow removing store code from different store v…
kapilpandya22 cc2b237
Change integration yml file
kapilpandya22 3f5eb9d
Change yml file
kapilpandya22 deb2c4e
Change integration yml file
kapilpandya22 ad220f8
Change integration yml file
kapilpandya22 d08f8d2
Change integration yml file
kapilpandya22 0eb6a50
Change integration yml file
kapilpandya22 9d219be
Change integration yml file
kapilpandya22 2fa54a5
Change integration yml file
kapilpandya22 99b4271
Change integration yml file
kapilpandya22 8d4a577
PR changes
kapilpandya22 1cedd92
PR changes
kapilpandya22 0575909
Improve smaller things,DEV-1790
norgeindian 02970d1
Make PR Changes
kapilpandya22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| namespace CustomGento\DefaultStoreCodeRemover\Model; | ||
|
|
||
| use Magento\Framework\App\Config\ScopeConfigInterface; | ||
|
|
||
| class Config | ||
| { | ||
| 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) | ||
| { | ||
| } | ||
|
|
||
| public function isPerStoreConfigEnabled(): bool | ||
| { | ||
| return $this->scopeConfig->isSetFlag(self::XML_PATH_USE_PER_STORE_CONFIG); | ||
| } | ||
|
|
||
| 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)); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <?xml version="1.0"?> | ||
| <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd"> | ||
| <system> | ||
| <section id="web"> | ||
| <group id="url"> | ||
| <field id="use_per_store_config" translate="label comment" type="select" sortOrder="15" showInDefault="1" showInWebsite="0" showInStore="0"> | ||
| <label>Configure Store Code Removal Per Store</label> | ||
| <comment><![CDATA[<strong>No (default):</strong> The default store has its store code removed from the URL; all other stores keep it.<br/> | ||
| <strong>Yes:</strong> You choose individually which stores have their store code removed.]]></comment> | ||
| <source_model>Magento\Config\Model\Config\Source\Yesno</source_model> | ||
| <depends> | ||
| <field id="use_store">1</field> | ||
| </depends> | ||
| </field> | ||
| <field id="stores_without_store_code" translate="label comment" type="multiselect" sortOrder="16" showInDefault="1" showInWebsite="0" showInStore="0"> | ||
| <label>Stores Without Store Code in URL</label> | ||
| <comment>Select every store whose store code should be removed from the URL.</comment> | ||
| <source_model>Magento\Config\Model\Config\Source\Store</source_model> | ||
| <depends> | ||
| <field id="use_store">1</field> | ||
| <field id="use_per_store_config">1</field> | ||
| </depends> | ||
| </field> | ||
| </group> | ||
| </section> | ||
| </system> | ||
| </config> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| <?xml version="1.0"?> | ||
| <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd"> | ||
| <default> | ||
| <web> | ||
| <url> | ||
| <use_per_store_config>0</use_per_store_config> | ||
| <stores_without_store_code></stores_without_store_code> | ||
| </url> | ||
| </web> | ||
| </default> | ||
| </config> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.