Skip to content
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

"appendStoreCode" is not inherited by /IT store #3270

Closed
2 of 5 tasks
alinadivante opened this issue Jul 23, 2019 · 2 comments
Closed
2 of 5 tasks

"appendStoreCode" is not inherited by /IT store #3270

alinadivante opened this issue Jul 23, 2019 · 2 comments
Assignees
Labels
bug Bug reports P2: Important Priority mark - still high ;) S: Small effort Small change to existing code, will take 1 or a couple of hours
Milestone

Comments

@alinadivante
Copy link
Collaborator

alinadivante commented Jul 23, 2019

Current behavior

In default config you can see

"de": {
"storeCode": "de",
"disabled": true,
"storeId": 3,
"name": "German Store",
"url": "/de",
"appendStoreCode": true,
"elasticsearch": {
"host": "/api/catalog",
"index": "vue_storefront_catalog_de"
},
"tax": {
"sourcePriceIncludesTax": false,
"defaultCountry": "DE",
"defaultRegion": "",
"calculateServerSide": true
},
"i18n": {
"fullCountryName": "Germany",
"fullLanguageName": "German",
"defaultLanguage": "DE",
"defaultCountry": "DE",
"defaultLocale": "de-DE",
"currencyCode": "EUR",
"currencySign": "EUR",
"dateFormat": "HH:mm D-M-YYYY"
}
},
"it": {
"extend": "de",
"storeCode": "it",
"disabled": true,
"storeId": 4,
"name": "Italian Store",
"url": "/it",
"elasticsearch": {
"host": "/api/catalog",
"index": "vue_storefront_catalog_it"
},
"tax": {
"defaultCountry": "IT"
},
"i18n": {
"fullCountryName": "Italy",
"fullLanguageName": "Italian",
"defaultCountry": "IT",
"defaultLanguage": "IT",
"defaultLocale": "it-IT"
}

Despite the fact that in the config we have the "expand:de" parameter for /it the store, at the address http://localhost:3000/it does not work without "appendStoreCode ": true,

We are redirected to 404 page not found.

Expected behavior

With "extend" parameter, the settings from /de store should be copied to /it and both stores should open and work correctly.

Steps to reproduce the issue

  1. Open https://test.storefrontcloud.io/
  2. Switch to https://test.storefrontcloud.io/it

Repository

Can you handle fixing this bug by yourself?

  • YES
  • NO

Which Release Cycle state this refers to? Info for developer.

Pick one option.

  • This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from develop branch and create Pull Request 2. Feature / Improvement back to develop.
  • This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from release branch and create Pull Request 3. Stabilisation fix back to release.
  • This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from hotfix or master branch and create Pull Request 4. Hotfix back to hotfix.

Environment details

  • Browser:
  • OS:
  • Node:
  • Code Version:

Additional information

@alinadivante alinadivante added the bug Bug reports label Jul 23, 2019
@pkarw pkarw added this to the 1.10.0 milestone Jul 23, 2019
@pkarw pkarw added P2: Important Priority mark - still high ;) S: Small effort Small change to existing code, will take 1 or a couple of hours labels Jul 23, 2019
@lukeromanowicz
Copy link
Contributor

lukeromanowicz commented Jul 25, 2019

The problem is a little bit deeper. Currently, it's working this way:

  • Server initializes full default storeview including translations, sync task storage etc
  • Server adds to the router every single page for every single storeview defined in the config
  • Server's router matches a page with the corresponding storecode
  • Server initializes full target storeview by storecode from the previous step <-- extend mechanism is here

appendStoreCode is used in 2nd step, while it's being inherited in the 4th step. That's the root issue.
The quickest way is to mention in the docs that for performance reasons this very attribute is not inherited in extend mechanism. Otherwise, we would have to initialize every single storeview even if they are not used.

The preferred solution is to rewrite the whole app initialization section because it makes no sense to initialize default storeview if it's not gonna be used.

@pkarw @filrak what do we do about it?

@pkarw
Copy link
Collaborator

pkarw commented Jul 25, 2019

Thanks for the investigation @lukeromanowicz. At this point as we’ve got some more urgent priorities it’s fine to close it with just updating the docs; @alinadivante wdyt? We can create another issue for rewriting this app init code for like 2.0 or 2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports P2: Important Priority mark - still high ;) S: Small effort Small change to existing code, will take 1 or a couple of hours
Projects
None yet
Development

No branches or pull requests

3 participants