예제 #1
0
                    $sql = 'SELECT distinct LOWER(TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) AS id, TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ') AS name 
			            FROM `' . _DB_PREFIX_ . 'sellerinfo_lang` sil 
						WHERE sil.id_lang = ' . $context->cookie->id_lang . ' AND LENGTH(TRIM(sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) > 0
					    ORDER BY sil.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ' ASC
		            ';
                } else {
                    $sql = 'SELECT distinct LOWER(TRIM(si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ')) AS id, TRIM(si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ') AS name 
			            FROM `' . _DB_PREFIX_ . 'sellerinfo` si
					    ORDER BY si.' . AgileMultipleShop::SHOP_BY_CUSTOM_FIELD . ' ASC
		            ';
                }
                break;
        }
        if (empty($sql)) {
            return array();
        }
        return Db::getInstance()->ExecuteS($sql);
    }
    public static function init_shop_header()
    {
        $main_shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
        include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
        Context::getContext()->smarty->assign(array('is_agilemultipleshop_installed' => 1, 'header_logo_mode' => intval(Configuration::get('ASP_HEADER_LOGO_MODE')), 'base_dir_default' => $main_shop->getBaseURL(), 'seller_shop_name' => Context::getContext()->shop->name, 'id_shop_owner' => Shop::$id_shop_owner, 'seller_logo_url' => isset(Shop::$sellerinfo) ? SellerInfo::get_seller_logo_url_static(Shop::$sellerinfo->id) : ''));
    }
    public static function clear_blockcategory_cache()
    {
        @session_start();
        if (!isset($_SESSION['id_shop_owner'])) {
            $_SESSION['id_shop_owner'] = 0;
        }
        if ($_SESSION['id_shop_owner'] != Shop::$id_shop_owner) {
            $_SESSION['id_shop_owner'] = Shop::$id_shop_owner;
            Context::getContext()->smarty->clearAllCache();
        }
    }
    public static function get_rewrite_rules()
    {