protected function agilemultipleseller_list_override()
 {
     global $cookie;
     if (!Module::isInstalled('agilemultipleseller')) {
         return;
     }
     parent::agilemultipleseller_list_override();
     if ($this->is_seller) {
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         $specialcid = AgileMultipleSeller::getSpecialCatrgoryIds();
         if (!empty($specialcid)) {
             $this->_where = $this->_where . ' AND a.id_category NOT IN (' . $specialcid . ')';
         }
     }
 }
예제 #2
0
 public static function getAdditionalSqlForProducts($prefix, $no_special_products = false)
 {
     ${"GLOBALS"}["qbpillwdqhw"] = "joins";
     global $cookie;
     $bnfkpwzt = "wheres";
     ${"GLOBALS"}["ecafcfauvj"] = "selects";
     ${${"GLOBALS"}["qbpillwdqhw"]} = "";
     ${$bnfkpwzt} = "";
     ${${"GLOBALS"}["ecafcfauvj"]} = "";
     if (Module::isInstalled("agilemultipleseller")) {
         ${"GLOBALS"}["ogqvqekzcei"] = "selects";
         $cehswdyr = "wheres";
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         $hratdiosptm = "selects";
         ${${"GLOBALS"}["cdubpnxpp"]} = ${${"GLOBALS"}["cdubpnxpp"]} . "\n                 LEFT JOIN `" . _DB_PREFIX_ . "product_owner` a_po ON " . ${${"GLOBALS"}["iovsympqalmr"]} . ".id_product=a_po.id_product\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo` a_s ON a_po.id_owner=a_s.id_seller\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo_lang` a_sl ON (a_sl.id_sellerinfo=a_s.id_sellerinfo  AND a_sl.id_lang=" . intval($cookie->id_lang) . ")\n                 ";
         ${$hratdiosptm} = ${${"GLOBALS"}["wgqnccp"]} . "\n                ,a_sl.company as seller, a_s.id_seller\n            ";
         if (Module::isInstalled("agilesellerproducts") || Module::isInstalled("agilemultipleshop")) {
             ${${"GLOBALS"}["ogqvqekzcei"]} = ${${"GLOBALS"}["wgqnccp"]} . "\n                    ,1 AS has_sellerlink\n                ";
         }
         ${${"GLOBALS"}["sqvyrbsmve"]} = ${$cehswdyr} . (Shop::${${"GLOBALS"}["asetpaoyo"]} > 0 ? " AND a_s.id_seller=" . Shop::${${"GLOBALS"}["asetpaoyo"]} : "");
         if (intval(Configuration::get("AGILE_MS_PRODUCT_APPROVAL"))) {
             ${${"GLOBALS"}["sqvyrbsmve"]} = ${${"GLOBALS"}["sqvyrbsmve"]} . " AND (IFNULL(a_po.approved,0) = 1 OR IFNULL(a_po.id_owner,0)=0) ";
         }
         ${${"GLOBALS"}["slqodv"]} = AgileMultipleSeller::getSpecialCatrgoryIds();
         if (!empty(${${"GLOBALS"}["slqodv"]}) && ${${"GLOBALS"}["lurnfazmgdw"]}) {
             ${"GLOBALS"}["tmoswbxd"] = "wheres";
             $ublevtzrv = "prefix";
             ${${"GLOBALS"}["sqvyrbsmve"]} = ${${"GLOBALS"}["tmoswbxd"]} . " AND " . ${$ublevtzrv} . ".id_category_default NOT IN (" . ${${"GLOBALS"}["slqodv"]} . ")";
         }
     }
     $yqtrtodwq = "selects";
     if (Module::isInstalled("agilesellerlistoptions")) {
         $smpcvvuq = "selects";
         ${"GLOBALS"}["xveodkujwp"] = "aslo_list_prod_id";
         ${"GLOBALS"}["rxoiuswx"] = "wheres";
         $mspglcmhvy = "wheres";
         require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         $oimprhaqfxck = "selects";
         ${${"GLOBALS"}["cdubpnxpp"]} = ${${"GLOBALS"}["cdubpnxpp"]} . "\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slh ON (" . ${${"GLOBALS"}["iovsympqalmr"]} . ".id_product = a_slh.id_product AND a_slh.id_option = " . AgileSellerListOptions::ASLO_OPTION_HOT . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slt ON (" . ${${"GLOBALS"}["iovsympqalmr"]} . ".id_product = a_slt.id_product AND a_slt.id_option = " . AgileSellerListOptions::ASLO_OPTION_LISTTOP . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slb ON (" . ${${"GLOBALS"}["iovsympqalmr"]} . ".id_product = a_slb.id_product AND a_slb.id_option = " . AgileSellerListOptions::ASLO_OPTION_LIST . ")\n                ";
         ${$smpcvvuq} = ${$oimprhaqfxck} . "\n            \t\t\t,CASE WHEN a_slh.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 1 ELSE 0 END AS ishot\n            \t\t\t,CASE WHEN a_slt.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 0-RAND() ELSE 0 END AS position2\n                    ";
         ${${"GLOBALS"}["xveodkujwp"]} = intval(Configuration::get("ASLO_PROD_FOR_OPTION" . AgileSellerListOptions::ASLO_OPTION_LIST));
         ${$mspglcmhvy} = ${${"GLOBALS"}["rxoiuswx"]} . " \n    \t\t    AND (a_slb.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " OR IFNULL(a_po.id_owner,0) = 0 OR " . ${${"GLOBALS"}["zpgnkgcenzfj"]} . "=" . AgileSellerListOptions::ASLO_ALWAYS_FREE . ")\n\t\t\t\t\n                ";
     }
     return array("selects" => ${$yqtrtodwq}, "joins" => ${${"GLOBALS"}["cdubpnxpp"]}, "wheres" => ${${"GLOBALS"}["sqvyrbsmve"]});
 }
예제 #3
0
파일: Category.php 프로젝트: evilscripts/gy
    public static function getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang, Shop $shop = null, $use_shop_context = true)
    {
        global $cookie;
        if (!Module::isInstalled('agilemultipleseller')) {
            return parent::getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang, $shop, $use_shop_context);
        }
        $isSeller = (intval($cookie->profile) == Configuration::get('AGILE_MS_PROFILE_ID') or intval($cookie->profile) == 0);
        if (!$isSeller) {
            return parent::getChildrenWithNbSelectedSubCat($id_parent, $selectedCat, $id_lang, $shop, $use_shop_context);
        }
        require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
        require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
        if (intval($cookie->profile) > 0) {
            $id_seller = $cookie->id_employee;
        } else {
            $sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($cookie->id_customer));
            $id_seller = $sellerinfo->id_seller;
        }
        $exclude = AgileMultipleSeller::getSpecialCatrgoryIds();
        $selectedCat = explode(',', str_replace(' ', '', $selectedCat));
        return Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('
		SELECT c.`id_category`, c.`level_depth`, cl.`name`, IF((
			SELECT COUNT(*)
			FROM `' . _DB_PREFIX_ . 'category` c2
			WHERE c2.`id_parent` = c.`id_category`
		) > 0, 1, 0) AS has_children, ' . ($selectedCat ? '(
			SELECT count(c3.`id_category`)
			FROM `' . _DB_PREFIX_ . 'category` c3
			WHERE c3.`nleft` > c.`nleft`
			AND c3.`nright` < c.`nright`
			AND c3.`id_category`  IN (' . implode(',', array_map('intval', $selectedCat)) . ')
		)' : '0') . ' AS nbSelectedSubCat
		FROM `' . _DB_PREFIX_ . 'category` c
		LEFT JOIN `' . _DB_PREFIX_ . 'category_lang` cl ON c.`id_category` = cl.`id_category`
		LEFT JOIN `' . _DB_PREFIX_ . 'category_owner` co ON c.id_category=co.id_category
		WHERE `id_lang` = ' . (int) $id_lang . '
		AND c.`id_parent` = ' . (int) $id_parent . '
		' . (empty($exclude) ? '' : 'AND c.id_category NOT IN (' . $exclude . ')') . '
		AND (IFNULL(co.id_owner,0) = ' . $id_seller . ' OR IFNULL(co.id_owner,0)=0)
		ORDER BY `position` ASC');
    }
예제 #4
0
 public static function getAdditionalSqlForProducts($prefix, $no_special_products = false)
 {
     global $cookie;
     $vshdbxbxy = "joins";
     ${"GLOBALS"}["slkpfyj"] = "wheres";
     ${$vshdbxbxy} = "";
     ${${"GLOBALS"}["slkpfyj"]} = "";
     ${${"GLOBALS"}["qklcrwgsidco"]} = "";
     if (Module::isInstalled("agilemultipleseller")) {
         $vzrhnjqp = "selects";
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         ${"GLOBALS"}["jqepmqv"] = "joins";
         ${"GLOBALS"}["tksljnls"] = "id_shop_owner";
         ${"GLOBALS"}["bitdhd"] = "wheres";
         ${"GLOBALS"}["konpwwtfjc"] = "selects";
         ${${"GLOBALS"}["ejltorqhfnj"]} = ${${"GLOBALS"}["jqepmqv"]} . "\n                 LEFT JOIN `" . _DB_PREFIX_ . "product_owner` a_po ON " . ${${"GLOBALS"}["pkcceulpqufx"]} . ".id_product=a_po.id_product\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo` a_s ON a_po.id_owner=a_s.id_seller\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo_lang` a_sl ON (a_sl.id_sellerinfo=a_s.id_sellerinfo  AND a_sl.id_lang=" . intval($cookie->id_lang) . ")\n                 ";
         ${"GLOBALS"}["gqvsnujethu"] = "specialcategoryids";
         ${"GLOBALS"}["mrfrflcbmalr"] = "specialcategoryids";
         ${${"GLOBALS"}["qklcrwgsidco"]} = ${$vzrhnjqp} . "\n                ,a_sl.company as seller, a_s.id_seller\n            ";
         if (Module::isInstalled("agilesellerproducts") || Module::isInstalled("agilemultipleshop")) {
             ${${"GLOBALS"}["konpwwtfjc"]} = ${${"GLOBALS"}["qklcrwgsidco"]} . "\n                    ,1 AS has_sellerlink\n                ";
         }
         ${${"GLOBALS"}["gimgar"]} = ${${"GLOBALS"}["bitdhd"]} . (Shop::${${"GLOBALS"}["tksljnls"]} > 0 ? " AND a_s.id_seller=" . Shop::${${"GLOBALS"}["shvvnhvtjfqu"]} : "");
         if (intval(Configuration::get("AGILE_MS_PRODUCT_APPROVAL"))) {
             ${${"GLOBALS"}["gimgar"]} = ${${"GLOBALS"}["gimgar"]} . " AND (IFNULL(a_po.approved,0) = 1 OR IFNULL(a_po.id_owner,0)=0) ";
         }
         ${${"GLOBALS"}["gqvsnujethu"]} = AgileMultipleSeller::getSpecialCatrgoryIds();
         if (!empty(${${"GLOBALS"}["mrfrflcbmalr"]}) && ${${"GLOBALS"}["nfupddsve"]}) {
             ${"GLOBALS"}["olnqpjtxd"] = "prefix";
             $qvnevhuedep = "wheres";
             ${$qvnevhuedep} = ${${"GLOBALS"}["gimgar"]} . " AND " . ${${"GLOBALS"}["olnqpjtxd"]} . ".id_category_default NOT IN (" . ${${"GLOBALS"}["lapmpjdp"]} . ")";
         }
     }
     ${"GLOBALS"}["pdxbiim"] = "joins";
     if (Module::isInstalled("agilesellerlistoptions")) {
         ${"GLOBALS"}["kwnlmkbr"] = "aslo_list_prod_id";
         $gobcpqwvnbe = "selects";
         require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         ${${"GLOBALS"}["ejltorqhfnj"]} = ${${"GLOBALS"}["ejltorqhfnj"]} . "\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slh ON (" . ${${"GLOBALS"}["pkcceulpqufx"]} . ".id_product = a_slh.id_product AND a_slh.id_option = " . AgileSellerListOptions::ASLO_OPTION_HOT . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slt ON (" . ${${"GLOBALS"}["pkcceulpqufx"]} . ".id_product = a_slt.id_product AND a_slt.id_option = " . AgileSellerListOptions::ASLO_OPTION_LISTTOP . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slb ON (" . ${${"GLOBALS"}["pkcceulpqufx"]} . ".id_product = a_slb.id_product AND a_slb.id_option = " . AgileSellerListOptions::ASLO_OPTION_LIST . ")\n                ";
         ${${"GLOBALS"}["qklcrwgsidco"]} = ${$gobcpqwvnbe} . "\n            \t\t\t,CASE WHEN a_slh.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 1 ELSE 0 END AS ishot\n            \t\t\t,CASE WHEN a_slt.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 0-RAND() ELSE 0 END AS position2\n                    ";
         ${${"GLOBALS"}["dfsemgtkzih"]} = intval(Configuration::get("ASLO_PROD_FOR_OPTION" . AgileSellerListOptions::ASLO_OPTION_LIST));
         ${${"GLOBALS"}["gimgar"]} = ${${"GLOBALS"}["gimgar"]} . " \n    \t\t    AND (a_slb.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " OR IFNULL(a_po.id_owner,0) = 0 OR " . ${${"GLOBALS"}["kwnlmkbr"]} . "=" . AgileSellerListOptions::ASLO_ALWAYS_FREE . ")\n\t\t\t\t\n                ";
     }
     return array("selects" => ${${"GLOBALS"}["qklcrwgsidco"]}, "joins" => ${${"GLOBALS"}["pdxbiim"]}, "wheres" => ${${"GLOBALS"}["gimgar"]});
 }
예제 #5
0
 public static function getAdditionalSqlForProducts($prefix, $no_special_products = false)
 {
     ${"GLOBALS"}["godpdq"] = "selects";
     $pbcmtiuk = "selects";
     global $cookie;
     ${${"GLOBALS"}["lkcurszuhc"]} = "";
     ${${"GLOBALS"}["ncxvfho"]} = "";
     ${$pbcmtiuk} = "";
     if (Module::isInstalled("agilemultipleseller")) {
         $ixzbhpwgrinp = "prefix";
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         ${"GLOBALS"}["pcubme"] = "selects";
         ${"GLOBALS"}["qncnntksflgt"] = "joins";
         ${${"GLOBALS"}["qncnntksflgt"]} = ${${"GLOBALS"}["lkcurszuhc"]} . "\n                 LEFT JOIN `" . _DB_PREFIX_ . "product_owner` a_po ON " . ${$ixzbhpwgrinp} . ".id_product=a_po.id_product\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo` a_s ON a_po.id_owner=a_s.id_seller\n                 LEFT JOIN `" . _DB_PREFIX_ . "sellerinfo_lang` a_sl ON (a_sl.id_sellerinfo=a_s.id_sellerinfo  AND a_sl.id_lang=" . intval($cookie->id_lang) . ")\n                 ";
         ${${"GLOBALS"}["pcubme"]} = ${${"GLOBALS"}["ccoeljcij"]} . "\n                ,a_sl.company as seller, a_s.id_seller\n            ";
         ${"GLOBALS"}["uskduybgnvt"] = "specialcategoryids";
         if (Module::isInstalled("agilesellerproducts") || Module::isInstalled("agilemultipleshop")) {
             ${${"GLOBALS"}["ccoeljcij"]} = ${${"GLOBALS"}["ccoeljcij"]} . "\n                    ,1 AS has_sellerlink\n                ";
         }
         ${"GLOBALS"}["iadfbyiqgt"] = "wheres";
         ${${"GLOBALS"}["iadfbyiqgt"]} = ${${"GLOBALS"}["ncxvfho"]} . (Shop::${${"GLOBALS"}["rknkcoe"]} > 0 ? " AND a_s.id_seller=" . Shop::${${"GLOBALS"}["rknkcoe"]} : "");
         if (intval(Configuration::get("AGILE_MS_PRODUCT_APPROVAL"))) {
             $jiuzebi = "wheres";
             $dhtnprvmuny = "wheres";
             ${$jiuzebi} = ${$dhtnprvmuny} . " AND (IFNULL(a_po.approved,0) = 1 OR IFNULL(a_po.id_owner,0)=0) ";
         }
         ${${"GLOBALS"}["chfpcumr"]} = AgileMultipleSeller::getSpecialCatrgoryIds();
         if (!empty(${${"GLOBALS"}["uskduybgnvt"]}) && ${${"GLOBALS"}["yionhvcshev"]}) {
             ${"GLOBALS"}["jwxlnhqgzxt"] = "wheres";
             ${"GLOBALS"}["erdpypmcd"] = "specialcategoryids";
             ${${"GLOBALS"}["jwxlnhqgzxt"]} = ${${"GLOBALS"}["ncxvfho"]} . " AND " . ${${"GLOBALS"}["prbfqjy"]} . ".id_category_default NOT IN (" . ${${"GLOBALS"}["erdpypmcd"]} . ")";
         }
     }
     ${"GLOBALS"}["mgdpocwuuyku"] = "joins";
     if (Module::isInstalled("agilesellerlistoptions")) {
         ${"GLOBALS"}["ekunbay"] = "prefix";
         $feczqlwomcl = "selects";
         $fbekkz = "joins";
         require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         ${"GLOBALS"}["lbjdmwo"] = "selects";
         ${${"GLOBALS"}["lkcurszuhc"]} = ${$fbekkz} . "\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slh ON (" . ${${"GLOBALS"}["ekunbay"]} . ".id_product = a_slh.id_product AND a_slh.id_option = " . AgileSellerListOptions::ASLO_OPTION_HOT . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slt ON (" . ${${"GLOBALS"}["prbfqjy"]} . ".id_product = a_slt.id_product AND a_slt.id_option = " . AgileSellerListOptions::ASLO_OPTION_LISTTOP . ")\n                LEFT JOIN `" . _DB_PREFIX_ . "seller_listoption` a_slb ON (" . ${${"GLOBALS"}["prbfqjy"]} . ".id_product = a_slb.id_product AND a_slb.id_option = " . AgileSellerListOptions::ASLO_OPTION_LIST . ")\n                ";
         ${$feczqlwomcl} = ${${"GLOBALS"}["lbjdmwo"]} . "\n            \t\t\t,CASE WHEN a_slh.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 1 ELSE 0 END AS ishot\n            \t\t\t,CASE WHEN a_slt.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " THEN 0-RAND() ELSE 0 END AS position2\n                    ";
         $zbthywvmfvb = "wheres";
         ${${"GLOBALS"}["ncxvfho"]} = ${$zbthywvmfvb} . " \n    \t\t    AND (a_slb.status = " . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . " OR IFNULL(a_po.id_owner,0) = 0)\n\t\t\t\t\n                ";
     }
     return array("selects" => ${${"GLOBALS"}["godpdq"]}, "joins" => ${${"GLOBALS"}["mgdpocwuuyku"]}, "wheres" => ${${"GLOBALS"}["ncxvfho"]});
 }
 private function initiContentForInformation()
 {
     $vhafmkgxjva = "category_nbr";
     $mvcrgvbvcb = "language";
     $myqwjjy = "category_nbr";
     $dutlbmuk = "categories";
     ${$mvcrgvbvcb} = new Language($this->id_language);
     ${${"GLOBALS"}["jhyxxhuo"]} = file_exists(_PS_ROOT_DIR_ . "/js/tiny_mce/langs/" . $language->iso_code . ".js") ? $language->iso_code : "en";
     ${"GLOBALS"}["gfbjkeb"] = "ad";
     ${${"GLOBALS"}["kuvwml"]} = str_replace("\\", "\\\\", dirname($_SERVER["PHP_SELF"]));
     $crebbb = "categories";
     $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer), self::$cookie->id_lang);
     ${$dutlbmuk} = array();
     ${$myqwjjy} = (int) Db::getInstance()->getValue("SELECT COUNT(*) AS cnt FROM " . _DB_PREFIX_ . "category");
     if (${$vhafmkgxjva} <= 1000) {
         $kmgfuo = "specialcids";
         ${"GLOBALS"}["uvadbayndxqr"] = "specialcids";
         $uxpwiboxxa = "sql";
         ${${"GLOBALS"}["vvskebgpewm"]} = "SELECT c.id_category, c.id_parent, cl.name \n\t\t\tFROM " . _DB_PREFIX_ . "category c \n\t\t\t\tINNER JOIN " . _DB_PREFIX_ . "category_owner co ON (c.id_category=co.id_category AND (IFNULL(co.id_owner,0)=0 OR IFNULL(co.id_owner,0)=" . intval($this->sellerinfo->id_seller) . "))\n\t\t\t\tLEFT JOIN " . _DB_PREFIX_ . "category_lang cl ON (c.id_category=cl.id_category AND cl.id_lang=" . $this->context->language->id . " AND cl.id_shop=" . $this->context->shop->id . ")\n\t\t\t\tWHERE c.id_category > 1\n\t\t\t\t";
         $einijh = "specialcids";
         ${"GLOBALS"}["wzpgiddtedw"] = "caterows";
         ${$kmgfuo} = AgileMultipleSeller::getSpecialCatrgoryIds();
         if (!empty(${${"GLOBALS"}["uvadbayndxqr"]})) {
             ${$uxpwiboxxa} .= " AND c.id_category NOT IN (" . ${$einijh} . ")";
         }
         ${${"GLOBALS"}["gmagdrofuuu"]} = Db::getInstance()->ExecuteS(${${"GLOBALS"}["vvskebgpewm"]});
         ${${"GLOBALS"}["kkajzqyo"]} = AgileHelper::getSortedFullnameCategory(${${"GLOBALS"}["wzpgiddtedw"]});
     }
     $ohvjrmga = "HOOK_PRODYCT_LIST_OPTIONS";
     ${$ohvjrmga} = "";
     if (Module::isInstalled("agilesellerlistoptions")) {
         include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         ${${"GLOBALS"}["nbpjcibnley"]} = new AgileSellerListOptions();
         ${${"GLOBALS"}["kenogesux"]} = $aslo_module->hookAgileAdminProductsFormTop(array("for_front" => 1, "id_product" => $this->object->id), true);
     }
     $newCatFormat = $this->getNewCategoryFormat();
     self::$smarty->assign(array("ad" => ${${"GLOBALS"}["gfbjkeb"]}, "isoTinyMCE" => ${${"GLOBALS"}["jhyxxhuo"]}, "theme_css_dir" => _THEME_CSS_DIR_, "ajaxurl" => _MODULE_DIR_, "suppliers" => Supplier::getSuppliers(), "manufacturers" => Manufacturer::getManufacturers(), "currency" => new Currency((int) Configuration::get("PS_CURRENCY_DEFAULT")), "ps_ssl_enabled" => Configuration::get("PS_SSL_ENABLED"), "is_pack" => $this->object->id && Pack::isPack($this->object->id) || Tools::getValue("ppack") || Tools::getValue("type_product") == Product::PTYPE_PACK, "categories" => ${$crebbb}, "new_categories" => $newCatFormat, "order_out_of_stock" => Configuration::get("PS_ORDER_OUT_OF_STOCK"), "bullet_common_field" => "", "is_agilesellerlistoptions_installed" => Module::isInstalled("agilesellerlistoptions"), "HOOK_PRODYCT_LIST_OPTIONS" => ${${"GLOBALS"}["kenogesux"]}));
 }
예제 #7
0
    public static function getAdditionalSqlForProducts($prefix, $no_special_products = false)
    {
        global $cookie;
        $joins = '';
        $wheres = '';
        $selects = '';
        if (Module::isInstalled('agilemultipleseller')) {
            require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
            $joins = $joins . '
                 LEFT JOIN `' . _DB_PREFIX_ . 'product_owner` a_po ON ' . $prefix . '.id_product=a_po.id_product
                 LEFT JOIN `' . _DB_PREFIX_ . 'sellerinfo` a_s ON a_po.id_owner=a_s.id_seller
                 LEFT JOIN `' . _DB_PREFIX_ . 'sellerinfo_lang` a_sl ON (a_sl.id_sellerinfo=a_s.id_sellerinfo  AND a_sl.id_lang=' . intval($cookie->id_lang) . ')
                 ';
            $selects = $selects . '
                ,a_sl.company as seller, a_s.id_seller
            ';
            if (Module::isInstalled('agilesellerproducts') || Module::isInstalled('agilemultipleshop')) {
                $selects = $selects . '
                    ,1 AS has_sellerlink
                ';
            }
            $wheres = $wheres . (Shop::$id_shop_owner > 0 ? ' AND a_s.id_seller=' . Shop::$id_shop_owner : '');
            if (intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL'))) {
                $wheres = $wheres . ' AND (IFNULL(a_po.approved,0) = 1 OR IFNULL(a_po.id_owner,0)=0) ';
            }
            $specialcategoryids = AgileMultipleSeller::getSpecialCatrgoryIds();
            if (!empty($specialcategoryids) && $no_special_products) {
                $wheres = $wheres . ' AND ' . $prefix . '.id_category_default NOT IN (' . $specialcategoryids . ')';
            }
        }
        if (Module::isInstalled('agilesellerlistoptions')) {
            require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
            $joins = $joins . '
                LEFT JOIN `' . _DB_PREFIX_ . 'seller_listoption` a_slh ON (' . $prefix . '.id_product = a_slh.id_product AND a_slh.id_option = ' . AgileSellerListOptions::ASLO_OPTION_HOT . ')
                LEFT JOIN `' . _DB_PREFIX_ . 'seller_listoption` a_slt ON (' . $prefix . '.id_product = a_slt.id_product AND a_slt.id_option = ' . AgileSellerListOptions::ASLO_OPTION_LISTTOP . ')
                LEFT JOIN `' . _DB_PREFIX_ . 'seller_listoption` a_slb ON (' . $prefix . '.id_product = a_slb.id_product AND a_slb.id_option = ' . AgileSellerListOptions::ASLO_OPTION_LIST . ')
                ';
            $selects = $selects . '
            			,CASE WHEN a_slh.status = ' . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . ' THEN 1 ELSE 0 END AS ishot
            			,CASE WHEN a_slt.status = ' . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . ' THEN 0-RAND() ELSE 0 END AS position2
                    ';
            $aslo_list_prod_id = intval(Configuration::get('ASLO_PROD_FOR_OPTION' . AgileSellerListOptions::ASLO_OPTION_LIST));
            $wheres = $wheres . ' 
    		    AND (a_slb.status = ' . AgileSellerListOptions::ASLO_STATUS_IN_EFFECT . ' OR IFNULL(a_po.id_owner,0) = 0 OR ' . $aslo_list_prod_id . '=' . AgileSellerListOptions::ASLO_ALWAYS_FREE . ')
				
                ';
        }
        return array('selects' => $selects, 'joins' => $joins, 'wheres' => $wheres);
    }