public function __construct() { parent::__construct(); $this->location_level = AgileMultipleShop::getShopByLocationLevel(); $this->id_location = AgileMultipleShop::getShopByLocationID(); $this->custom_field = AgileMultipleShop::SHOP_BY_CUSTOM_FIELD; }
public function processData() { $nbProducts = $this->getProducts(NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->pagination((int) $nbProducts); self::$smarty->assign('nb_products', (int) $nbProducts); $seller_products = $this->getProducts((int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay); AgileHelper::AssignProductImgs($seller_products); $si_1531_later = version_compare(_PS_VERSION_, '1.5.3.1', ">="); include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php"; $module = new AgileMultipleShop(); self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'id_location' => $this->id_location, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . '/modules/' . (_PS_VERSION_ > '1.5' ? 'agilemultipleshop' : 'agilesellerproducts') . '/', 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('category') : 'category'), 'mediumSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('medium') : 'medium'), 'thumbSceneSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('thumb_scene') : 'thumb_scene'), 'homeSize' => Image::getSize($si_1531_later ? ImageType::getFormatedName('home') : 'home'), 'path' => $module->getL('Shop By Location'))); $ver = (int) str_replace(".", "", _PS_VERSION_); if (isset(self::$cookie->id_compare)) { self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare)); } self::$smarty->assign(array('seller_locations4page' => agilemultipleshop::getLocationListNV($this->location_level), 'location_level4page' => $this->location_level)); self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'))); }
protected function __construct() { if (Module::isInstalled('agilemultipleshop')) { include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php"; $this->default_routes = array_merge($this->default_routes, AgileMultipleShop::get_rewrite_rules()); } if (Module::isInstalled('agileshowcasemanager')) { include_once _PS_ROOT_DIR_ . "/modules/agileshowcasemanager/agileshowcasemanager.php"; $this->default_routes = array_merge($this->default_routes, AgileShowcaseManager::get_rewrite_rules()); } parent::__construct(); }
public static function createSellerInfo($customer, $address, $seller_emp) { ${"GLOBALS"}["qjdqsmikhyx"] = "sellerinfo"; $yhqkobb = "id_sellerinfo"; global $cookie; ${${"GLOBALS"}["xgwqqivqgrf"]} = SellerInfo::getIdBSellerId($seller_emp->id); ${${"GLOBALS"}["qjdqsmikhyx"]} = new SellerInfo(${$yhqkobb}); $sellerinfo->id_customer = $customer->id; $sellerinfo->id_seller = $seller_emp->id; $sellerinfo->approved = intval(Configuration::get("AGILE_MS_SELLER_APPROVAL")) == 1 ? 0 : 1; if (Tools::getValue("signin")) { $qilskqt = "languages"; $sellerinfo->id_country = intval(Tools::getValue("id_country")); ${"GLOBALS"}["cjvrzut"] = "languages"; if (Country::containsStates($sellerinfo->id_country)) { $sellerinfo->id_state = intval(Tools::getValue("id_state")); } $sellerinfo->postcode = Tools::getValue("postcode"); $sellerinfo->phone = Tools::getValue("phone"); ${$qilskqt} = Language::getLanguages(false); foreach (${${"GLOBALS"}["cjvrzut"]} as ${${"GLOBALS"}["vdilblgqwe"]}) { ${"GLOBALS"}["egyhwy"] = "lang"; $parkrxwevda = "lang"; $sellerinfo->company[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = Tools::getValue("company_" . ${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]); $sellerinfo->city[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = Tools::getValue("city_" . ${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]); $sellerinfo->address1[${${"GLOBALS"}["egyhwy"]}["id_lang"]] = Tools::getValue("address1_" . ${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]); $sellerinfo->address2[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = Tools::getValue("address2_" . ${$parkrxwevda}["id_lang"]); } } else { $fuyjkdnrw = "languages"; $sellerinfo->id_country = $address->id_country; $sellerinfo->id_state = $address->id_state; $sellerinfo->postcode = $address->postcode; $sellerinfo->phone = $address->phone; ${${"GLOBALS"}["wcurgtbzth"]} = empty($address->company) ? $customer->firstname . " " . $customer->lastname : $address->company; ${$fuyjkdnrw} = Language::getLanguages(false); foreach (${${"GLOBALS"}["lchilkwh"]} as ${${"GLOBALS"}["vdilblgqwe"]}) { $sellerinfo->company[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = ${${"GLOBALS"}["wcurgtbzth"]}; $sellerinfo->city[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = $address->city; $sellerinfo->address1[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = $address->address1; $sellerinfo->address2[${${"GLOBALS"}["vdilblgqwe"]}["id_lang"]] = $address->address2; } } $sellerinfo->longitude = 0; $sellerinfo->latitude = 0; $sellerinfo->ams_custom_date1 = "1900-01-01"; $sellerinfo->ams_custom_date2 = "1900-01-01"; $sellerinfo->ams_custom_date3 = "1900-01-01"; $sellerinfo->ams_custom_date4 = "1900-01-01"; $sellerinfo->ams_custom_date5 = "1900-01-01"; if ($sellerinfo->save()) { if (Module::isInstalled("agilemultipleshop") && $sellerinfo->id_shop <= 0) { ${"GLOBALS"}["wbhwjpwmjrh"] = "shop_name"; ${"GLOBALS"}["plelmru"] = "shop_name"; include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php"; ${${"GLOBALS"}["wbhwjpwmjrh"]} = $sellerinfo->company[$cookie->id_lang]; $jpxkuueptq = "shop_name"; if (empty(${$jpxkuueptq})) { ${${"GLOBALS"}["plelmru"]} = $seller_emp->firstname . "-" . $seller_emp->lastname; } $sellerinfo->id_shop = AgileMultipleShop::create_new_shop($sellerinfo->id_seller, $sellerinfo->company[$cookie->id_lang]); $sellerinfo->update(); } } ${"GLOBALS"}["ciniqzqxiff"] = "sellerinfo"; return ${${"GLOBALS"}["ciniqzqxiff"]}; }
public function getPaginationLink($type, $id_object, $nb = false, $sort = false, $pagination = false, $array = false) { global $link; $pagename = AgileHelper::getPageName(); if (Module::isInstalled('agilemultipleshop')) { require_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php"; if ($pagename == "agilesellers.php") { $url = $this->getAgileSellersLink(Tools::getValue('filter'), NULL, Tools::getValue('loclevel'), Tools::getValue('parentid')); if (strpos($url, "?") === false) { $url .= "?"; } $seller_location = Tools::getValue('seller_location'); if (!empty($seller_location)) { $url .= "&seller_location=" . $seller_location; } $seller_type = Tools::getValue('seller_type'); if (!empty($seller_type)) { $url .= "&seller_type=" . $seller_type; } $userview = Tools::getValue('userview'); if (!empty($userview)) { $url .= "&userview=" . $userview; } $n = Tools::getValue('n'); if (!empty($n)) { $url .= "&n=" . (int) $n; } return $url; } if ($pagename == "sellerlocation.php") { $url = $this->getSellerLocationLink(AgileMultipleShop::getShopByLocationID(), AgileMultipleShop::getShopByLocationLevel()); if (strpos($url, "?") === false) { $url .= "?"; } return $url; } } $fc = Tools::getValue('fc'); $module = Tools::getValue('module'); $controller = Tools::getValue('controller'); if ($fc == 'module' and !empty($module) and !empty($controller) and strlen($module) > 5 && substr($module, 0, 5) == "agile") { $url = $this->getModuleLink($module, $controller, array(), true); if (strpos($url, "?") === false) { $url .= "?"; } return $url; } if ($pagename == "sellerorders.php") { $url = $this->getModuleLink('agilemultipleseller', 'sellerorders', array(), true); if (strpos($url, "?") === false) { $url .= "?"; } return $url; } if ($pagename == "sellerhistory.php") { $url = $this->getModuleLink('agilemultipleseller', 'sellerhistory', array(), true); if (strpos($url, "?") === false) { $url .= "?"; } return $url; } return parent::getPaginationLink($type, $id_object, $nb, $sort, $pagination, $array); }
$asp_sellers = Db::getInstance()->ExecuteS($sql); for ($idx = 0; $idx < count($asp_sellers); $idx++) { $asp_sellers[$idx]['seller_logo_url'] = SellerInfo::get_seller_logo_url_static($asp_sellers[$idx]['id_sellerinfo']); } if (!$asp_sellers) {
protected function processSubmitSellerinfo() { $lang_cookie = self::$cookie->id_lang; if ($lang_cookie != 1) { $_POST['address1_1'] = $_POST['address1_' . $lang_cookie]; $_POST['address2_1'] = $_POST['address1_' . $lang_cookie]; $_POST['address2_1'] = $_POST['address1_' . $lang_cookie]; $_POST['city_1'] = $_POST['city_' . $lang_cookie]; $_POST['description_1'] = $_POST['description_' . $lang_cookie]; } ${"GLOBALS"}["vjnnsubap"] = "list"; $vhheljumal = "selected_country"; $zryhlvp = "list"; $tjuksry = "countries"; ${"GLOBALS"}["vpjnzdqa"] = "countries"; if (Tools::isSubmit("id_country") && !is_null(Tools::getValue("id_country")) && is_numeric(Tools::getValue("id_country"))) { ${$vhheljumal} = (int) Tools::getValue("id_country"); } else { if (isset($this->sellerinfo) && isset($this->sellerinfo->id_country) && !empty($this->sellerinfo->id_country) && is_numeric($this->sellerinfo->id_country)) { ${${"GLOBALS"}["ontiydub"]} = (int) $this->sellerinfo->id_country; } else { if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) { $duwbhhjzvvl = "array"; ${$duwbhhjzvvl} = preg_split("/,|-/", $_SERVER["HTTP_ACCEPT_LANGUAGE"]); if (!Validate::isLanguageIsoCode(${${"GLOBALS"}["tjlrhpthnf"]}[0]) || !(${${"GLOBALS"}["ontiydub"]} = Country::getByIso(${${"GLOBALS"}["tjlrhpthnf"]}[0]))) { ${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT"); } } else { ${${"GLOBALS"}["ontiydub"]} = (int) Configuration::get("PS_COUNTRY_DEFAULT"); } } } if (Configuration::get("PS_RESTRICT_DELIVERED_COUNTRIES")) { ${${"GLOBALS"}["vpjnzdqa"]} = Carrier::getDeliveredCountries($this->context->language->id, true, true); } else { ${${"GLOBALS"}["coohkibbnl"]} = Country::getCountries($this->context->language->id, true); } ${$zryhlvp} = ""; $countries = ${$tjuksry}; /**************** LANGUAGE LEVEL *******************/ $seller_id_lang = $this->sellerinfo->id_seller; $langLevel = Tools::getValue("lang_level"); $dialect = Tools::getValue("lang"); $main_lang = Tools::getValue('main_lang'); /*foreach ($dialect as $key => $value) { $level = $langLevel[$key]; Db::getInstance(_PS_USE_SQL_SLAVE_)->execute(" INSERT INTO " . _DB_PREFIX_ . "sellerinfo_language (seller_id, language, language_level) VALUES ('$seller_id_lang', '$value', '$level') "); }*/ // die('<pre>' . print_r($dialect, true)); $langLevel = implode(',', Tools::getValue("lang_level")); $languages = implode(',', Tools::getValue("lang")); $this->sellerinfo->language = $languages; $this->sellerinfo->language_level = $langLevel; $this->sellerinfo->main_language = $main_lang; $jlbwjt = "shop_name"; ${"GLOBALS"}["oonrqhi"] = "shop_name"; ${"GLOBALS"}["zlobvkbr"] = "virtual_uri"; AgileMultipleSeller::ensure_date_custom_field(); $uskhfeodhv = "zip_code_format"; ${${"GLOBALS"}["oonrqhi"]} = ""; if (isset($_POST["shop_name"])) { ${$jlbwjt} = trim($_POST["shop_name"], " "); } $famsbcd = "country"; if (isset($_POST["virtual_uri"])) { ${${"GLOBALS"}["zlobvkbr"]} = Tools::link_rewrite(trim($_POST["virtual_uri"], " /")) . "/"; } /*if (empty($_POST["postcode"])) $this->errors[] = Tools::displayError("Postcode is required field.");*/ if (empty($_POST["address1_1"])) { $this->errors[] = Tools::displayError("Address is required field."); } if (empty($_POST["city_1"])) { $this->errors[] = Tools::displayError("City is required field."); } if (empty($_POST["phone"])) { $this->errors[] = Tools::displayError("Phone is required field."); } $this->errors = array_merge($this->errors, $this->sellerinfo->validateController()); $this->sellerinfo->id_customer = self::$cookie->id_customer; if (Module::isInstalled("agilemultipleshop")) { $mcovgfrp = "shop_name"; ${"GLOBALS"}["xdpblji"] = "seller_shopurl"; if (empty(${$mcovgfrp})) { $this->errors[] = Tools::displayError("The shop name can not be empty."); } if (empty($_POST["virtual_uri"]) and (int) Configuration::get("ASP_SHOP_URL_MODE") == agilemultipleshop::SHOP_URL_MODE_VIRTUAL) { $this->errors[] = Tools::displayError("The shop Virtual Uri can not be empty."); } ${"GLOBALS"}["edessnqo"] = "id_found"; ${"GLOBALS"}["kkzhciyk"] = "seller_shop"; if ($this->sellerinfo->id_shop <= 1) { $this->sellerinfo->id_shop = 0; } ${${"GLOBALS"}["kkzhciyk"]} = new Shop($this->sellerinfo->id_shop); if (Shop::shop_name_duplicated(${${"GLOBALS"}["oxjolt"]}, $seller_shop->id)) { $this->errors[] = Tools::displayError("The shop name you select has been used by other seller. Please choose a new one."); } ${"GLOBALS"}["asepnxuok"] = "seller_shop"; if ($this->errors) { return; } if (!Validate::isLoadedObject(${${"GLOBALS"}["asepnxuok"]})) { $this->sellerinfo->id_shop = AgileMultipleShop::create_new_shop($this->sellerinfo->id_seller, ${${"GLOBALS"}["oxjolt"]}); $this->sellerinfo->update(); ${${"GLOBALS"}["esrnnrtkg"]} = new Shop($this->sellerinfo->id_shop); } ${${"GLOBALS"}["xdpblji"]} = new ShopUrl(Shop::get_main_url_id($seller_shop->id)); ${${"GLOBALS"}["edessnqo"]} = $seller_shopurl->canAddThisUrl($seller_shopurl->domain, $seller_shopurl->domain_ssl, $seller_shopurl->physical_uri, ${${"GLOBALS"}["uovivsqns"]}); if (intval(${${"GLOBALS"}["vphoqso"]}) > 0) { $this->errors[] = Tools::displayError("The uri you select has been used by other seller. Please choose a new one."); } } ${"GLOBALS"}["uehqptpfhppm"] = "seller_shop"; if (!(${${"GLOBALS"}["flggvi"]} = new Country($this->sellerinfo->id_country)) || !Validate::isLoadedObject(${$famsbcd})) { throw new PrestaShopException("Country cannot be loaded with address->id_country"); } if ((int) $country->contains_states && !(int) $this->sellerinfo->id_state) { $this->errors[] = Tools::displayError("This country requires a state selection."); } ${$uskhfeodhv} = $country->zip_code_format; if ($country->need_zip_code) { $guefxsgyxvp = "zip_code_format"; ${"GLOBALS"}["ayucbbdhdhcq"] = "zip_code_format"; $krvjmkmqh = "postcode"; ${"GLOBALS"}["smbwfoxbj"] = "zip_code_format"; if ((${${"GLOBALS"}["wnwubvg"]} = Tools::getValue("postcode")) && ${${"GLOBALS"}["ayucbbdhdhcq"]}) { ${"GLOBALS"}["gusjike"] = "zip_regexp"; ${"GLOBALS"}["bgahkjn"] = "zip_regexp"; $edhlvb = "zip_regexp"; ${"GLOBALS"}["yvbcolkxptn"] = "zip_regexp"; $pslxhegowq = "zip_regexp"; ${${"GLOBALS"}["ctdciodhb"]} = "/^" . ${${"GLOBALS"}["ebwpvmqblmd"]} . "\$/ui"; ${"GLOBALS"}["mivinoyltqoh"] = "zip_regexp"; ${$pslxhegowq} = str_replace(" ", "( |)", ${${"GLOBALS"}["ctdciodhb"]}); ${${"GLOBALS"}["mivinoyltqoh"]} = str_replace("-", "(-|)", ${${"GLOBALS"}["bgahkjn"]}); ${${"GLOBALS"}["ctdciodhb"]} = str_replace("N", "[0-9]", ${${"GLOBALS"}["gusjike"]}); ${${"GLOBALS"}["ctdciodhb"]} = str_replace("L", "[a-zA-Z]", ${${"GLOBALS"}["ctdciodhb"]}); ${${"GLOBALS"}["ctdciodhb"]} = str_replace("C", $country->iso_code, ${${"GLOBALS"}["yvbcolkxptn"]}); // if (!preg_match(${$edhlvb}, ${${"GLOBALS"}["wnwubvg"]})) // $this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is invalid.") . "<br />" . Tools::displayError("Must be typed as follows:") . " " . str_replace("C", $country->iso_code, str_replace("N", "0", str_replace("L", "A", ${${"GLOBALS"}["ebwpvmqblmd"]}))); } /*else if (${$guefxsgyxvp}) $this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is required."); else if (${${"GLOBALS"}["wnwubvg"]} && !preg_match("/^[0-9a-zA-Z -]{4,9}\$/ui", ${$krvjmkmqh})) $this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is invalid.") . "<br />" . Tools::displayError("Must be typed as follows:") . " " . str_replace("C", $country->iso_code, str_replace("N", "0", str_replace("L", "A", ${${"GLOBALS"}["smbwfoxbj"]}))); */ } if ($country->isNeedDni() && (!Tools::getValue("dni") || !Validate::isDniLite(Tools::getValue("dni")))) { $this->errors[] = Tools::displayError("Identification number is incorrect or has already been used."); } $this->sellerinfo->dni = Tools::getValue("dni"); $this->sellerinfo->latitude = Tools::getValue("latitude"); $this->sellerinfo->longitude = Tools::getValue("longitude"); $this->sellerinfo->id_sellertype1 = Tools::getValue("id_sellertype1"); $this->sellerinfo->id_sellertype2 = Tools::getValue("id_sellertype2"); // echo '<pre>', print_r($_FILES, true) , '</pre>'; SellerInfo::processLogoUpload($this->sellerinfo); SellerInfo::processLicenseUpload($this->sellerinfo); $this->errors = array_merge($this->errors, $this->sellerinfo->validateController()); if (!empty($this->errors)) { return; } $this->sellerinfo->save(); if (Module::isInstalled("agilemultipleshop") and Validate::isLoadedObject(${${"GLOBALS"}["uehqptpfhppm"]})) { $wrheluzg = "shop_name"; $seller_shop->name = ${$wrheluzg}; $seller_shop->save(); ${"GLOBALS"}["sxuwmytjl"] = "virtual_uri"; $seller_shopurl->virtual_uri = ${${"GLOBALS"}["sxuwmytjl"]}; $seller_shopurl->save(); Tools::generateHtaccess(); } if (empty($this->errors)) { self::$smarty->assign("cfmmsg_flag", 1); } }
private function assignLocationBlockData() { $hnngvewyhr = "location_level"; ${$hnngvewyhr} = Configuration::get("ASP_LOCATION_BLOCK_LEVEL"); $this->context->smarty->assign(array("seller_locations4block" => AgileMultipleShop::getLocationListNV(${${"GLOBALS"}["ypxufldtomu"]}), "location_level" => ${${"GLOBALS"}["ypxufldtomu"]}, "asp_location_block_style" => (int) Configuration::get("ASP_LOCATION_BLOCK_STYLE"), "location_custom_field" => self::SHOP_BY_CUSTOM_FIELD, "location_custom_name" => self::SHOP_BY_CUSTOM_NAME, "agilemultipleshop_tpl" => dirname(__FILE__) . "/")); }
public function initHeader() { parent::initHeader(); if (Module::isInstalled('agilemultipleshop')) { include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php"; AgileMultipleShop::init_shop_header(); AgileMultipleShop::clear_blockcategory_cache(); } }