Pergunta

I am in the admin and my structure of the scopes is the following:

-> Default
----> Website A
--------> Store DE
--------> Store FR
----> Website B
--------> Store DE
--------> Store FR

So, now I am simply reloading the page and in the _afterLoad() method, in my custom Model, which extends the core backend model where, which redirects to my _afterLoad method, I want to get the ID of the current website, that I am loading (when I change the Scope from the upper left drop-down menu).

Mage::app()->getWebsite()->getId() does not help, because it always returns 0. I can get the store code, when I am loading one of the store scopes, and from this get their IDs, but the websites don't have codes, so this cannot help me either. Mage::getModel('core/website')->getWebsite->getId() does not work either.

I know that the IDs of website A and website B are respectively 1 and 2, but I don't know how to acquire them, when I am in the admin.

Nenhuma solução correta

Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange
scroll top