Questions tagged [store-code]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
21 views

How can I get the store code inside a block in the product page using the dependency injection?

I have to check which is the current store view. In order to do that I was using the Object Manager to get the store code like this: $storeCode = \Magento\Framework\App\ObjectManager::getInstance() ...
1
vote
2answers
176 views

Magento 2 Custom GET REST API ready store code from url

I have a custom REST API url: <route url="/V1/vendor/module/id/:Id" method="GET"> <service class="Vendor\Module\Api\ModuleRepositoryInterface" method="get"/> <resources&...
0
votes
0answers
24 views

Magento 2.3.4 Add store code per store view instead

I have 1 websites 1 store and 2 store view websites/Stores/Store View: 1- UK/England/English 2-UK/Ireland/Irish URL E.G is: https://domain.com/ Now I need to show store code in url only for ...
1
vote
1answer
179 views

How to get the store code in a phtml file of Magento2?

In a custom phtml file I have to get the code associated to the store view (not the Id), any idea how to get this?
0
votes
2answers
214 views

Magento2 - multistore using different domains, relative folder in base url & store codes… language switcher broken

This is a Magento 2.3.2 CE project Let's assume url of default storeview is https://www.domain.com/store/es Url of second storeview is https://www.domain.pt/pt Language switcher gives error, ...
0
votes
1answer
386 views

Magento 2 multiple websites. Do i need to set “Add the store code to the base URL” to yes

Following documentation in admin panel I've added second website. On each website (default and new) I have exactly one unique store and for each store I have exactly one unique view. Like below ...
1
vote
1answer
427 views

Magento 2.2 - How to redirect url with store code to url without store code?

The site is been indexed on Google with Store Code for each store view (it/en/gb/au) now the store codes are been removed from url, so all the links end up in a 404 error. How can I set an automatic ...
3
votes
1answer
838 views

Get store code, not store view code

Using the StoreManagerInterface I am getting the current store via $store = $this->storeManager->getStore(). I then want to get the code of the store. However, when using $store->getCode() ...
0
votes
3answers
3k views

Magento2 multistore - redirect url without store code to default storeView url

Not sure if this is a bug in this project, or a Magento2 bug itself The question is site is configured to use store code in urls, and that's working fine... but urls without any store code are loading ...
0
votes
1answer
355 views

can't access website after adding store code to url

I am using magento 2.2.2 My store was working fine till I added store code to urls so I am no longer able to access my website using my website url mystore.com I have to add store code to access ...
5
votes
4answers
18k views

Get Store ID by store code Magento 2

How to get Store ID by store code in Magento 2 Thanks
0
votes
1answer
1k views

Add Store Codes to URL

In admin panel under Url options, I want to turn on Store codes on Url, since I want to visit my country-specific pages. I'm running locally (using WAMP) so my IP is 127.0.0.1:8888. I did set my host ...
8
votes
1answer
670 views

Is there a reason hyphen/dash is not allowed in store codes?

Both M1 and M2 don't allow hyphens or dashes in its store codes. There is backend validation against it. However, it is not clear why. Any idea?
0
votes
1answer
605 views

Use same storecode for different websites

We have a multistore setup with 3 stores/domains, which should support different languages in the near future and I want to have the locale/language information in store URLs. Example: website1.com/...
1
vote
0answers
85 views

Store code url not changed by saving from backend as well as change value in database(core_config_data)

UPDATE core_config_data SET value=0 WHERE path='web/url/use_store' and scope_id=0 i want to remove store code from website url but it doesn't work. even i change value in database and it revert to ...
0
votes
1answer
199 views

Magento duplicate content issue with multistore

I have multi-store websites with store code enable in URL. As google will consider the product content as duplicate on case of multi-store with store code for same product.How can I resolve this issue ...
0
votes
1answer
1k views

check 'add store code to urls' enabled/not by admin

I need to get the exact URL when customer visit my site on first time, It is based on following options base url that depends on default website,store and store view, store code to urls enabled or ...