Hi,

Am Monday 11 October 2010 09:27:41 schrieb Sarunas Valaskevicius:
> > One hint from csimon says there maybe problems with the EE-Version.
>
> The problem is knowing the shop id, that is currently loaded by user, so as
> it may be taken from the session, oxSession instance is currently loaded
> first.
Ok. I don't know how the subshops are organized and don't know, if there are 
changes between EE and PE, so I don't look in the code.

So, I understand, that the current shop is defined in the session.
That listen for me, that is possible more differnt shops by the same URL...
... who use this, whats happen with SEM?

For me, it listen more nice, to get the shop_id by the request-url and don't 
use session.
Eg.:
www.example.com => Shop1
electronic.example.com => Shop2
clothes.example.com => Shop3
www.otherdomain.com => Shop4
etc.

Of course, (a little more complicated) it should be possible with subfolders, 
too.
www.example.com/mainShop => Shop1
www.example.com/clothes => Shop2
etc.

Remember, at this point you have the database connection, the salt-value and 
the current url.
oxconfig:
    public function init()
    {
        include getShopBasePath().'config.inc.php';//database connection
        include getShopBasePath().'core/oxconfk.php';//salt
        // load modules
        $this->_loadVarsFromDb( $this->getShopId(), array('aModules') );
        ....
    }

    /** 
     * use $_SERVER (eg. HTTP_HOST) for looking in the database, 
     *  find out, what shop is the current
     */
    public function getShopId(){
       ....
    }

Or, did I don't understand or there are more problems?


> There was the same question posted in this list previously (2010.06.16),
> with a pointer to a bug entry:
> https://bugs.oxid-esales.com/view.php?id=1097
You looking for a concept, what you think about the definition by request(look 
above)?

> For now, if this class module is really needed, there is a (not really
> nice) workaround to do it.
> As aModules config variables is usually taken from the oxconfig table - it
> is taken after loading the session.
>
> For earlier steps this parameter may be initialized in config.inc.php:
>
> $this->_aConfigParams['aModules'] = array('oxutilsfile' => 'module...');
>
> Note: this parameter will get overwritten by loading oxconfig table, so you
> may need to duplicate needed module entry here too in some cases.

Really, this workaround is the same, but using the database value, so all is 
up to date.
> > Insert at end of config.inc.php:
> >    include getShopBasePath().'core/oxconfk.php';
> >    $this->_loadVarsFromDb( $this->getShopId(), array('aModules') )

Regards,
Markus


_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to