public function getShopId()
    {
        if (is_null($this->_iShopId)) {
            $shopId = $this->calculateActiveShopId();
            $this->setShopId($shopId);

            if (!$this->_isValidShopId($shopId)) {
                $shopId = $this->getBaseShopId();
            }
            $this->setShopId($shopId);
        }

        return $this->_iShopId;
    }