Magento 2: Load storeview id in controller returns errorInjecting Dependencies into a Magento 2 CRUD/Abstract ModelMagento 2: Plugin class does not existMagento 2 unknown error on exception.logMagento 2 ErrorOverride __construct MagentoCatalogModelProductmagento error logs Error log record number: 1173359093956Warning: session_regenerate_id(): Session object destruction failed. on Magento 2 CheckoutMagento 2 Override ListProduct.php Block FileRuntimeException When i Load Helper Class magento 2Magento 2 Site is Inacessible
Meaning and structure of headline "Hair it is: A List of ..."
Why do so many people play out of turn on the last lead?
Unconventional examples of mathematical modelling
The Roommates' Dilemma
μονάδαι as plural form of μονάς
What are some tips and tricks for finding the cheapest flight when luggage and other fees are not revealed until far into the booking process?
Why don't modern jet engines use forced exhaust mixing?
Unsolved Problems due to Lack of Computational Power
Airline power sockets shut down when I plug my computer in. How can I avoid that?
Gofer work in exchange for Letter of Recommendation
What happened after the end of the Truman Show?
Can I submit a paper computer science conference using an alias if using my real name can cause legal trouble in my original country
Does the Temple of the Gods spell nullify critical hits?
Best model for precedence constraints within scheduling problem
What is the best way to use errors in mathematica M12?
How to use the passive form to say "This flower was watered."
When does The Truman Show take place?
Did Michelle Obama have a staff of 23; and Melania have a staff of 4?
Tikz: The position of a label change step-wise and not in a continuous way
Can anybody tell me who this Pokemon is?
Why should I pay for an SSL certificate?
Why does this image of cyclocarbon look like a nonagon?
Designing a prison for a telekinetic race
The anatomy of an organic infrared generator
Magento 2: Load storeview id in controller returns error
Injecting Dependencies into a Magento 2 CRUD/Abstract ModelMagento 2: Plugin class does not existMagento 2 unknown error on exception.logMagento 2 ErrorOverride __construct MagentoCatalogModelProductmagento error logs Error log record number: 1173359093956Warning: session_regenerate_id(): Session object destruction failed. on Magento 2 CheckoutMagento 2 Override ListProduct.php Block FileRuntimeException When i Load Helper Class magento 2Magento 2 Site is Inacessible
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I loaded following class into my controller:
use MagentoStoreModelStoreManagerInterface;
And injected it in my constructor:
StoreManagerInterface $storeManagerInterface,
However it returns following error:
Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: QxsVerkoopjeControllerIndexIndexInterceptor
How to load the storeManager in my controller?
magento2 store-view
|
show 3 more comments
I loaded following class into my controller:
use MagentoStoreModelStoreManagerInterface;
And injected it in my constructor:
StoreManagerInterface $storeManagerInterface,
However it returns following error:
Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: QxsVerkoopjeControllerIndexIndexInterceptor
How to load the storeManager in my controller?
magento2 store-view
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18
|
show 3 more comments
I loaded following class into my controller:
use MagentoStoreModelStoreManagerInterface;
And injected it in my constructor:
StoreManagerInterface $storeManagerInterface,
However it returns following error:
Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: QxsVerkoopjeControllerIndexIndexInterceptor
How to load the storeManager in my controller?
magento2 store-view
I loaded following class into my controller:
use MagentoStoreModelStoreManagerInterface;
And injected it in my constructor:
StoreManagerInterface $storeManagerInterface,
However it returns following error:
Exception #0 (MagentoFrameworkExceptionRuntimeException): Type Error occurred when creating object: QxsVerkoopjeControllerIndexIndexInterceptor
How to load the storeManager in my controller?
magento2 store-view
magento2 store-view
asked Aug 6 at 9:09
Coen PonsenCoen Ponsen
1511 silver badge10 bronze badges
1511 silver badge10 bronze badges
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18
|
show 3 more comments
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18
|
show 3 more comments
1 Answer
1
active
oldest
votes
Try to use this below way :
protected $_storeManager;
public function __construct(
.....
MagentoStoreModelStoreManagerInterface $storeManager,
.....
)
.....
$this->_storeManager = $storeManager;
.....
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
return $this->_storeManager->getStore()->getId();
After inject class in construct remove generated folder and clean cache.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284541%2fmagento-2-load-storeview-id-in-controller-returns-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Try to use this below way :
protected $_storeManager;
public function __construct(
.....
MagentoStoreModelStoreManagerInterface $storeManager,
.....
)
.....
$this->_storeManager = $storeManager;
.....
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
return $this->_storeManager->getStore()->getId();
After inject class in construct remove generated folder and clean cache.
add a comment |
Try to use this below way :
protected $_storeManager;
public function __construct(
.....
MagentoStoreModelStoreManagerInterface $storeManager,
.....
)
.....
$this->_storeManager = $storeManager;
.....
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
return $this->_storeManager->getStore()->getId();
After inject class in construct remove generated folder and clean cache.
add a comment |
Try to use this below way :
protected $_storeManager;
public function __construct(
.....
MagentoStoreModelStoreManagerInterface $storeManager,
.....
)
.....
$this->_storeManager = $storeManager;
.....
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
return $this->_storeManager->getStore()->getId();
After inject class in construct remove generated folder and clean cache.
Try to use this below way :
protected $_storeManager;
public function __construct(
.....
MagentoStoreModelStoreManagerInterface $storeManager,
.....
)
.....
$this->_storeManager = $storeManager;
.....
/**
* Get store identifier
*
* @return int
*/
public function getStoreId()
return $this->_storeManager->getStore()->getId();
After inject class in construct remove generated folder and clean cache.
answered Aug 6 at 9:24
Rohan HapaniRohan Hapani
8,7684 gold badges21 silver badges66 bronze badges
8,7684 gold badges21 silver badges66 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f284541%2fmagento-2-load-storeview-id-in-controller-returns-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Remove generated folder please.
– Rohan Hapani
Aug 6 at 9:13
Thanks, I thought i never have to do that in developer mode... Now it returns : Exception #0 (RuntimeException): Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you
– Coen Ponsen
Aug 6 at 9:21
Try to run php bin/magento setup:upgrade and php bin/magento setup:di:compile
– Moin Malek
Aug 6 at 9:34
It keeps returning:Class MagentoStoreModelStoreManagerInterface does not exist Class QxsVerkoopjeControllerIndexIndexInterceptor generation error: Th e requested class did not generate properly, because the 'generated' direct ory permission is read-only. If --- after running the 'bin/magento setup:di :compile' CLI command when the 'generated' directory permission is set to w rite --- the requested class did not generate properly, then you must add t he generated class object to the signature of the related construct method, only.
– Coen Ponsen
Aug 6 at 10:11
Go to this path vendor/magento/module-store/Model/StoreManagerInterface.php and check please file available or not.
– Rohan Hapani
Aug 6 at 10:18