예제 #1
1
 public function getFooter()
 {
     $parent_footer = parent::getFooter();
     if (!isset($this->order) or !Validate::isLoadedObject($this->order)) {
         return $parent_footer;
     }
     if (!Module::isInstalled('agilemultipleseller')) {
         return $parent_footer;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_seller = AgileSellerManager::getObjectOwnerID('order', $this->order->id);
     $sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId($id_seller), $this->order->id_lang);
     $id_lang = intval(Configuration::get('PS_COUNTRY_DEFAULT'));
     $this->smarty->assign(array('seller_name' => $sellerinfo->company, 'seller_address' => $sellerinfo->fulladdress($id_lang), 'seller_fax' => $sellerinfo->fax, 'seller_phone' => $sellerinfo->phone, 'sellerinfo' => $sellerinfo));
     return $this->smarty->fetch($this->getTemplate('footer'));
 }
예제 #2
0
 public function postProcess()
 {
     parent::postProcess();
     if (Module::isInstalled('agilemultipleseller') && Tools::getValue('passwd')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         $id_seller = SellerInfo::getSellerIdByCustomerId(Context::getContext()->customer->id);
         AgileSellerManager::syncSellerCredentials('f2b', $id_seller);
     }
 }
예제 #3
0
 public function delete()
 {
     $ret = parent::delete();
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         $id_seller = SellerInfo::getSellerIdByCustomerId($this->id);
         $emp = new Employee($id_seller);
         if (Validate::isLoadedObject($emp)) {
             $emp->delete();
         }
     }
     return $ret;
 }
예제 #4
0
 public function processLogoUpload($sellerInfo)
 {
     $bjgxat = "logo_folder";
     $cldhxdkxsql = "sellerInfo";
     if (!Validate::isLoadedObject(${$cldhxdkxsql})) {
         return;
     }
     ${$bjgxat} = SellerInfo::get_logo_folder();
     if (!empty($_FILES["logo"]["name"])) {
         ${"GLOBALS"}["iqhfttijafhx"] = "filename";
         $peuwuuwuavs = "filename";
         ${$peuwuuwuavs} = ${${"GLOBALS"}["bloixuz"]} . $sellerInfo->id . ".jpg";
         if (!move_uploaded_file($_FILES["logo"]["tmp_name"], ${${"GLOBALS"}["iqhfttijafhx"]})) {
         }
     }
 }
예제 #5
0
 public static function getHomeMetas($id_lang, $page_name)
 {
     if (!Module::isInstalled('agilemultipleshop') || !Module::isInstalled('agilemultipleseller')) {
         return parent::getHomeMetas($id_lang, $page_name);
     }
     if (Shop::$id_shop_owner <= 1) {
         return parent::getHomeMetas($id_lang, $page_name);
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_sellerinfo = SellerInfo::getIdBSellerId(Shop::$id_shop_owner);
     $sellerinfo = new SellerInfo($id_sellerinfo, $id_lang);
     $metas = Meta::getMetaByPage($page_name, $id_lang);
     $ret['meta_title'] = !empty($sellerinfo->meta_title) ? $sellerinfo->meta_title : $sellerinfo->company;
     $ret['meta_description'] = !empty($sellerinfo->meta_description) ? $sellerinfo->meta_description : '';
     $ret['meta_keywords'] = !empty($sellerinfo->meta_keywords) ? $sellerinfo->meta_description : '';
     return $ret;
 }
 private function check_seller_account()
 {
     if (!Module::isInstalled('agilemultipleseller')) {
         return;
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_customer = intval(Tools::getValue('id_customer', 0));
     $id_sellerinfo = SellerInfo::getIdByCustomerId($id_customer);
     $tokenSellerinfo = '';
     if ($id_sellerinfo > 0) {
         $tokenSellerinfo = Tools::getAdminToken('AdminSellerinfos' . (int) Tab::getIdFromClassName('AdminSellerinfos') . (int) $this->context->employee->id);
     }
     $tokenSellerEmployee = '';
     $sellerinfo = new SellerInfo($id_sellerinfo);
     if (Validate::isLoadedObject($sellerinfo)) {
         $tokenSellerEmployee = Tools::getAdminToken('AdminEmployees' . (int) Tab::getIdFromClassName('AdminEmployees') . (int) $this->context->employee->id);
     }
     $this->context->smarty->assign(array('id_sellerinfo' => $id_sellerinfo, 'tokenSellerinfo' => $tokenSellerinfo, 'id_seller_empployee' => $sellerinfo->id_seller, 'tokenSellerEmployee' => $tokenSellerEmployee, 'show_seller_options' => $this->is_seller ? 0 : 1));
 }
예제 #7
0
 public function init()
 {
     parent::init();
     ${"GLOBALS"}["tvubeipssbhz"] = "id_product";
     $bxgngnjmt = "action";
     $this->orderBy = Tools::getValue("agile_orderby");
     $this->orderWay = Tools::getValue("agile_orderway");
     $cegzdngh = "id_product";
     ${$bxgngnjmt} = Tools::getValue("process");
     ${$cegzdngh} = Tools::getValue("id_product");
     if (isset(${${"GLOBALS"}["xmejvhmbjf"]}) && isset(${${"GLOBALS"}["tvubeipssbhz"]})) {
         ${"GLOBALS"}["qcujxbitt"] = "action";
         $ljdeuuxtnpu = "action";
         if (${${"GLOBALS"}["qcujxbitt"]} == "delete") {
             $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($this->context->customer->id), $this->context->language->id);
             if ($this->sellerinfo->id_seller > 0 and $this->sellerinfo->id_seller == AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["kswjllrrkq"]})) {
                 ${"GLOBALS"}["jbichwqsqmye"] = "product";
                 $gmydjry = "product";
                 ${${"GLOBALS"}["xbssqyr"]} = new Product((int) ${${"GLOBALS"}["kswjllrrkq"]});
                 $this->beforeDelete(${${"GLOBALS"}["jbichwqsqmye"]});
                 if (!$product->delete()) {
                     $this->errors[] = Tools::displayError("Error occured during deleting the product.");
                 }
                 $this->afterDelete(${$gmydjry}, $product->id);
             } else {
                 $this->errors[] = Tools::displayError("You do not have permission to delete this product or the product is not found.");
             }
         } else {
             if (${${"GLOBALS"}["xmejvhmbjf"]} == "inactive" || ${$ljdeuuxtnpu} == "active") {
                 $gvvbmjfbht = "id_product";
                 ${${"GLOBALS"}["xbssqyr"]} = new Product((int) ${$gvvbmjfbht});
                 $product->active = !$product->active;
                 $product->update();
                 $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($this->context->customer->id), $this->context->language->id);
                 AgileSellerManager::assignObjectOwner("product", ${${"GLOBALS"}["kswjllrrkq"]}, $this->sellerinfo->id_seller);
             }
         }
     }
 }
예제 #8
0
 public function init()
 {
     if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) {
         $this->display_column_left = (int) Configuration::get('ASP_HOME_COLUMN_LEFT') == 1;
         $this->display_column_right = (int) Configuration::get('ASP_HOME_COLUMN_RIGHT') == 1;
     }
     parent::init();
     if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) {
         $this->productSort();
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php";
         $this->id_seller = (int) Tools::getValue('id_seller');
         if (_PS_VERSION_ > '1.5' and $this->id_seller <= 0) {
             $this->id_seller = Shop::$id_shop_owner;
         }
         if ($this->id_seller) {
             $this->seller = new Employee($this->id_seller);
             $this->seller_info = new SellerInfo(SellerInfo::getIdBSellerId($this->id_seller), self::$cookie->id_lang);
         }
     }
 }
 public function init()
 {
     $this->display_column_left = false;
     $this->display_column_right = false;
     parent::init();
     $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer));
     $this->seller = new Employee($this->sellerinfo->id_seller);
     $hcjkispeef = "seller_exists";
     ${"GLOBALS"}["rdwfndiorn"] = "pagename";
     ${${"GLOBALS"}["ndbfsnbuwdpq"]} = Validate::isLoadedObject($this->seller);
     $this->isSeller = (${$hcjkispeef} and $this->seller->active);
     ${${"GLOBALS"}["rdwfndiorn"]} = AgileHelper::getPageName();
     if (!${${"GLOBALS"}["ndbfsnbuwdpq"]} && ${${"GLOBALS"}["cvseqebxgmo"]} != "sellersummary.php") {
         $this->errors[] = Tools::displayError("You do not have permission to access this page. Please conatct store administrator.");
     }
     if (Module::isInstalled("agilesellerlistoptions")) {
         include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         ${${"GLOBALS"}["wokgohn"]} = new AgileSellerListOptions();
         self::$smarty->assign(array("pay_options_link" => $aslmodule->getPayOptionLink($this->sellerinfo->id_seller)));
     }
     self::$smarty->assign(array("isSeller" => $this->isSeller, "seller_exists" => ${${"GLOBALS"}["ndbfsnbuwdpq"]}, "agilemultipleseller_views" => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/", "agilemultipleseller_custom" => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/custom/", "sellerinfo" => $this->sellerinfo, "seller" => $this->seller, "seller_back_office" => (int) Configuration::get("AGILE_MS_SELLER_BACK_OFFICE"), "is_seller_shipping_installed" => Module::isInstalled("agilesellershipping"), "is_seller_commission_installed" => Module::isInstalled("agilesellercommission"), "is_seller_messenger_installed" => Module::isInstalled("agilesellermessenger"), "is_seller_ratings_installed" => Module::isInstalled("agilesellerratings"), "is_multiple_shop_installed" => Module::isInstalled("agilemultipleshop"), "is_seller_listoptions_installed" => Module::isInstalled("agilesellerlistoptions"), "is_agileprepaidcredit_installed" => Module::isInstalled("agileprepaidcredit"), "sellertoken" => Tools::encrypt("ams_seller") . ($this->isSeller ? $this->seller->passwd : ""), "admin_folder_name" => Configuration::get("AGILE_MS_ADMIN_FOLDER_NAME"), "selleremail" => $this->seller ? $this->seller->email : "", "ajaxurl" => _MODULE_DIR_, "seller_palenl_withleft" => (int) Configuration::get("AGILE_MS_SELLER_PANEL_WITHLEFT"), "seller_palenl_withright" => (int) Configuration::get("AGILE_MS_SELLER_PANEL_WITHRIGHT"), "is_seller_pickupcenter_installed" => Module::isInstalled("agilepickupcenter")));
 }
예제 #10
0
 public function renderForm()
 {
     global $cookie;
     ${"GLOBALS"}["uwnclc"] = "sellerinfo";
     $bmgitbrqeuu = "modules";
     ${"GLOBALS"}["wgdkpcgommt"] = "modules";
     if (!(${${"GLOBALS"}["xeglymvvpvoh"]} = $this->loadObject(true))) {
         return;
     }
     ${"GLOBALS"}["cmwmre"] = "labels";
     $mobaqoqkpbc = "modules";
     $lkpwvshwx = "modules";
     ${"GLOBALS"}["owcninq"] = "modules";
     ${$mobaqoqkpbc} = array();
     ${$bmgitbrqeuu}[] = array("name" => "", "desc" => "--");
     ${${"GLOBALS"}["gqijjcqhgij"]}[] = array("name" => "agilepaypal", "desc" => "Agile Paypal or Agile Paypal Adative");
     if (Module::isInstalled("agilebankwire")) {
         ${${"GLOBALS"}["owcninq"]}[] = array("name" => "bankwire", "desc" => "Aigle Bank Wire");
     }
     if (Module::isInstalled("agilegooglecheckout")) {
         ${${"GLOBALS"}["gqijjcqhgij"]}[] = array("name" => "googlecheckout", "desc" => "Agile Google Checkout");
     }
     ${"GLOBALS"}["eoyekwrdgm"] = "tokenSellerinfo";
     if (Module::isInstalled("agilepaybycheque")) {
         ${${"GLOBALS"}["wgdkpcgommt"]}[] = array("name" => "agilepaybycheque", "desc" => "Agile Pay by check");
     }
     if (Module::isInstalled("agilecashondelivery")) {
         ${${"GLOBALS"}["gqijjcqhgij"]}[] = array("name" => "agilecashondelivery", "desc" => "Aigle Cash On Delivery");
     }
     ${${"GLOBALS"}["cmwmre"]} = "\n\t\t\tvar labels = {\n\t\t\t\tagilepaypal: {info1:\"" . $this->l('Paypal Address:') . "\",info2:\"N/A\",info3:\"N/A\",info4:\"N/A\",info5:\"N/A\" } \n\t\t\t\t,bankwire: {info1:\"" . $this->l('Account Owner:') . "\",info2:\"" . $this->l('Details:') . "\",info3:\"" . $this->l('Bank address:') . "\",info4:\"N/A\",info5:\"N/A\"}\n\t\t\t\t,googlecheckout: {info1:\"" . $this->l('Merchant ID:') . "\",info2:\"" . $this->l('Merchant Key:') . "\",info3:\"N/A\",info4:\"N/A\",info5:\"N/A\"}\n\t\t\t\t,agilepaybycheque: {info1:\"" . $this->l('To the order of:') . "\",info2:\"" . $this->l('Address:') . "\",info3:\"N/A\",info4:\"N/A\",info5:\"N/A\"}\n\t\t\t\t,agilecashondelivery: {info1:\"" . $this->l('Notes at order:') . "\",info2:\"N/A\",info3:\"N/A\",info4:\"N/A\",info5:\"N/A\"} \n\t\t\t };\t\t\n\t\t";
     $this->fields_form = array("legend" => array("title" => $this->l('Seller Payment Info'), "image" => "../img/admin/tab-customers.gif"), "input" => array(array("type" => "text_sellerinfo", "label" => $this->l('Seller:'), "name" => "id_sellerinfo", "size" => 33, "required" => false), array("type" => "select", "label" => $this->l('Payment Module:'), "name" => "module_name", "options" => array("query" => ${$lkpwvshwx}, "id" => "name", "name" => "desc"), "required" => false), array("type" => "checkbox", "name" => "in_use", "values" => array("query" => array(array("id" => "on", "name" => $this->l('In Use'), "val" => "1")), "id" => "id", "name" => "name"), "required" => false), array("type" => "textarea", "label" => $this->l('Field 1:'), "name" => "info1", "rows" => 3, "cols" => 100, "required" => false), array("type" => "textarea", "label" => $this->l('Field 2:'), "name" => "info2", "rows" => 3, "cols" => 100, "required" => false), array("type" => "textarea", "label" => $this->l('Field 3:'), "name" => "info3", "rows" => 3, "cols" => 100, "required" => false), array("type" => "textarea", "label" => $this->l('Field 4:'), "name" => "info4", "size" => 33, "required" => false), array("type" => "textarea", "label" => $this->l('Field 5:'), "name" => "info5", "rows" => 3, "cols" => 100, "required" => false)));
     $this->fields_form["submit"] = array("title" => $this->l('Save'), "class" => "btn btn-default pull-right");
     ${${"GLOBALS"}["mdpjsyd"]} = new SellerInfo(SellerInfo::getIdBSellerId($this->object->id_seller));
     ${${"GLOBALS"}["eoyekwrdgm"]} = Tools::getAdminToken("AdminSellerinfos" . (int) Tab::getIdFromClassName("AdminSellerinfos") . (int) $this->context->employee->id);
     $this->tpl_form_vars = array("agilemultipleseller_views" => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/", "base_dir" => _PS_BASE_URL_ . __PS_BASE_URI__, "base_dir_ssl" => _PS_BASE_URL_SSL_ . __PS_BASE_URI__, "sellerinfo" => ${${"GLOBALS"}["uwnclc"]}, "tokenSellerinfo" => ${${"GLOBALS"}["fwqgvgb"]}, "sellers" => AgileSellerManager::getSellersNV(true, "--"), "is_seller" => $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID"), "labels" => ${${"GLOBALS"}["krpmgdw"]});
     $this->fields_value = array("in_use_on" => $this->getFieldValue(${${"GLOBALS"}["xeglymvvpvoh"]}, "in_use"));
     return parent::renderForm();
 }
예제 #11
0
 public static function get_current_logged_seller_home_category_id()
 {
     ${"GLOBALS"}["jmshhuxctr"] = "category";
     ${"GLOBALS"}["dqsyfllglj"] = "id_seller";
     ${"GLOBALS"}["bfdapv"] = "sellerinfo";
     if (!Module::isInstalled("agilemultipleseller")) {
         return 0;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $avkymxsi = "id_seller";
     ${"GLOBALS"}["ctdshgh"] = "category";
     ${$avkymxsi} = AgileSellerManager::current_logged_seller_id();
     if (${${"GLOBALS"}["pbiyrsaos"]} <= 0) {
         return 0;
     }
     ${${"GLOBALS"}["bfdapv"]} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["dqsyfllglj"]}));
     if ($sellerinfo->id_category_default <= 2) {
         return 0;
     }
     ${${"GLOBALS"}["jmshhuxctr"]} = new Category($sellerinfo->id_category_default, Context::getContext()->language->id);
     if (!Validate::isLoadedObject(${${"GLOBALS"}["ctdshgh"]})) {
         return 0;
     }
     return $sellerinfo->id_category_default;
 }
예제 #12
0
 public static function get_current_logged_seller_home_category_id()
 {
     ${"GLOBALS"}["fqgxtnved"] = "id_seller";
     if (!Module::isInstalled("agilemultipleseller")) {
         return 0;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${${"GLOBALS"}["fqgxtnved"]} = AgileSellerManager::current_logged_seller_id();
     if (${${"GLOBALS"}["ghjbfbenq"]} <= 0) {
         return 0;
     }
     ${${"GLOBALS"}["fgxqhdsi"]} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["ghjbfbenq"]}));
     ${"GLOBALS"}["dpwcnuha"] = "category";
     if ($sellerinfo->id_category_default <= 2) {
         return 0;
     }
     ${${"GLOBALS"}["dpwcnuha"]} = new Category($sellerinfo->id_category_default, Context::getContext()->language->id);
     if (!Validate::isLoadedObject(${${"GLOBALS"}["xslqxxkw"]})) {
         return 0;
     }
     return $sellerinfo->id_category_default;
 }
 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);
     }
 }
예제 #14
0
 public function validateController($htmlentities = true)
 {
     ${"GLOBALS"}["qvokpxp"] = "errors";
     $wgpvts = "field";
     ${"GLOBALS"}["yvnpfwzt"] = "required_fields_database";
     ${${"GLOBALS"}["qvokpxp"]} = array();
     $pwnpyvvih = "data";
     ${${"GLOBALS"}["ljiveifke"]} = Language::getLanguages(false);
     ${"GLOBALS"}["ayihnmvk"] = "default_language";
     ${${"GLOBALS"}["ayihnmvk"]} = new Language((int) Configuration::get("PS_LANG_DEFAULT"));
     ${${"GLOBALS"}["tquylljuk"]} = "SellerInfo";
     ${"GLOBALS"}["qlxwjnbhsld"] = "fieldsRequiredDatabase";
     ${${"GLOBALS"}["yvnpfwzt"]} = isset(self::${${"GLOBALS"}["dhtyhjdihlm"]}[get_class($this)]) ? self::${${"GLOBALS"}["qlxwjnbhsld"]}[get_class($this)] : array();
     foreach ($this->def["fields"] as ${$wgpvts} => ${$pwnpyvvih}) {
         ${"GLOBALS"}["ldqeiejmi"] = "field";
         ${"GLOBALS"}["mzlthpv"] = "field";
         $runwnk = "value";
         ${"GLOBALS"}["fpuljc"] = "field";
         ${"GLOBALS"}["ntpixskg"] = "value";
         ${"GLOBALS"}["spnaati"] = "value";
         ${"GLOBALS"}["skojvpla"] = "value";
         $wbvroskeu = "field";
         ${"GLOBALS"}["qgndecvge"] = "data";
         $urltcywzxdo = "value";
         $yvjdjqrxlw = "data";
         ${"GLOBALS"}["jhstjcwuy"] = "required_fields_database";
         $pviioxnj = "value";
         if (in_array(${${"GLOBALS"}["nsrqxdsfw"]}, ${${"GLOBALS"}["jhstjcwuy"]})) {
             ${${"GLOBALS"}["iwnmlbb"]}["required"] = true;
         }
         if (isset(${${"GLOBALS"}["iwnmlbb"]}["required"]) && ${${"GLOBALS"}["iwnmlbb"]}["required"] && (${${"GLOBALS"}["skojvpla"]} = Tools::getValue(${${"GLOBALS"}["ldqeiejmi"]}, $this->{${${"GLOBALS"}["mzlthpv"]}})) == false && (string) ${$pviioxnj} != "0") {
             if (!$this->id || ${${"GLOBALS"}["nsrqxdsfw"]} != "passwd") {
                 $zetdmofamt = "htmlentities";
                 $ywohmlrfbnh = "field";
                 ${${"GLOBALS"}["xgynkihlk"]}[] = "<b>" . self::displayFieldName(${$ywohmlrfbnh}, get_class($this), ${$zetdmofamt}) . "</b> " . Tools::displayError("is required.");
             }
         }
         if (isset(${${"GLOBALS"}["qgndecvge"]}["size"]) && (${${"GLOBALS"}["spnaati"]} = Tools::getValue(${$wbvroskeu}, $this->{${${"GLOBALS"}["nsrqxdsfw"]}})) && Tools::strlen(${${"GLOBALS"}["ntpixskg"]}) > ${$yvjdjqrxlw}["size"]) {
             $piwznejj = "data";
             $dlcyqqmxyc = "field";
             ${${"GLOBALS"}["xgynkihlk"]}[] = sprintf(Tools::displayError("%1\$s is too long. Maximum length: %2\$d"), self::displayFieldName(${$dlcyqqmxyc}, get_class($this), ${${"GLOBALS"}["thutunrxpxi"]}), ${$piwznejj}["size"]);
         }
         ${${"GLOBALS"}["wfflirafolq"]} = Tools::getValue(${${"GLOBALS"}["fpuljc"]}, $this->{${${"GLOBALS"}["nsrqxdsfw"]}});
         if (${$urltcywzxdo} || ${${"GLOBALS"}["wfflirafolq"]} == "0" || ${${"GLOBALS"}["nsrqxdsfw"]} == "postcode" && ${$runwnk} == "0") {
             $lmfyshwbdhu = "field";
             ${"GLOBALS"}["rfjxsv"] = "field";
             $kfuebbjho = "field";
             if (${${"GLOBALS"}["nsrqxdsfw"]} == "company" || ${${"GLOBALS"}["nsrqxdsfw"]} == "description" || ${${"GLOBALS"}["nsrqxdsfw"]} == "address1" || ${$kfuebbjho} == "address2" || ${${"GLOBALS"}["rfjxsv"]} == "city" || in_array(${$lmfyshwbdhu}, SellerInfo::getCustomMultiLanguageFields())) {
                 $npjnrrbqcu = "field";
                 $gnbvmqgsjne = "empty";
                 $bugdocnlwylp = "language";
                 $bksuduoel = "empty";
                 $pfktclkpyrm = "field";
                 ${"GLOBALS"}["gnwnnefkkal"] = "field";
                 // if ( ( ${${"GLOBALS"}["gnwnnefkkal"]} == "company" || ${${"GLOBALS"}["nsrqxdsfw"]} == "address1" || ${$npjnrrbqcu} == "city" ) && ( ( ${$gnbvmqgsjne} = Tools::getValue( ${$pfktclkpyrm} . "_" . $default_language->id ) ) === false || ${$bksuduoel} !== "0" && empty( ${${"GLOBALS"}["ptnvnxrnw"]} ) ) ) {
                 if (${${"GLOBALS"}["gnwnnefkkal"]} == "company" && ((${$gnbvmqgsjne} = Tools::getValue(${$pfktclkpyrm} . "_" . $default_language->id)) === false || ${$bksuduoel} !== "0" && empty(${${"GLOBALS"}["ptnvnxrnw"]}))) {
                     ${"GLOBALS"}["doslmnuqidd"] = "class_name";
                     ${"GLOBALS"}["aqlwwfiq"] = "class_name";
                     ${${"GLOBALS"}["xgynkihlk"]}[] = sprintf(Tools::displayError("The field %1\$s is required at least in %2\$s."), call_user_func(array(${${"GLOBALS"}["doslmnuqidd"]}, "displayFieldName"), ${${"GLOBALS"}["nsrqxdsfw"]}, ${${"GLOBALS"}["aqlwwfiq"]}), $default_language->name);
                 }
                 ${${"GLOBALS"}["wpnbfimr"]} = "";
                 foreach (${${"GLOBALS"}["ljiveifke"]} as ${$bugdocnlwylp}) {
                     $cndzkijievc = "field";
                     ${${"GLOBALS"}["wpnbfimr"]} = Tools::getValue(${$cndzkijievc} . "_" . ${${"GLOBALS"}["znrbdvbetm"]}["id_lang"]);
                     if (!empty(${${"GLOBALS"}["wpnbfimr"]})) {
                         break;
                     }
                 }
                 foreach (${${"GLOBALS"}["ljiveifke"]} as ${${"GLOBALS"}["znrbdvbetm"]}) {
                     $lldgwfe = "language";
                     ${"GLOBALS"}["vsmetocbel"] = "field_lang_value";
                     ${"GLOBALS"}["xivpfytplj"] = "field_lang_value";
                     ${${"GLOBALS"}["xivpfytplj"]} = Tools::getValue(${${"GLOBALS"}["nsrqxdsfw"]} . "_" . ${$lldgwfe}["id_lang"]);
                     ${"GLOBALS"}["brtzwoc"] = "field_lang_value";
                     ${"GLOBALS"}["gtkfqtcf"] = "field_lang_value_default";
                     ${"GLOBALS"}["ewqypbcfttt"] = "field_lang_value";
                     if (${${"GLOBALS"}["ewqypbcfttt"]} !== false && Tools::strlen(${${"GLOBALS"}["vsmetocbel"]}) > ${${"GLOBALS"}["iwnmlbb"]}["size"]) {
                         ${"GLOBALS"}["wtwtictfns"] = "errors";
                         $wdwsuuwkquqt = "field";
                         $cuwecmug = "class_name";
                         ${"GLOBALS"}["swcuxu"] = "language";
                         ${${"GLOBALS"}["wtwtictfns"]}[] = sprintf(Tools::displayError("The field %1\$s (%2\$s) is too long (%3\$d chars max, html chars including)."), call_user_func(array(${$cuwecmug}, "displayFieldName"), ${$wdwsuuwkquqt}, ${${"GLOBALS"}["tquylljuk"]}), ${${"GLOBALS"}["swcuxu"]}["name"], ${${"GLOBALS"}["iwnmlbb"]}["size"]);
                     }
                     if (isset(${${"GLOBALS"}["iwnmlbb"]}["validate"]) && !Validate::${${"GLOBALS"}["iwnmlbb"]}["validate"](${${"GLOBALS"}["kdmkog"]}) && !empty(${${"GLOBALS"}["brtzwoc"]})) {
                         $grnizjh = "class_name";
                         $lmtxfwvvoce = "field";
                         $xhefwlyisa = "language";
                         ${${"GLOBALS"}["xgynkihlk"]}[] = sprintf(Tools::displayError("The field %1\$s (%2\$s) Is Invalid."), call_user_func(array(${$grnizjh}, "displayFieldName"), ${$lmtxfwvvoce}, ${${"GLOBALS"}["tquylljuk"]}), ${$xhefwlyisa}["name"]);
                     }
                     $this->{${${"GLOBALS"}["nsrqxdsfw"]}}[${${"GLOBALS"}["znrbdvbetm"]}["id_lang"]] = empty(${${"GLOBALS"}["kdmkog"]}) ? ${${"GLOBALS"}["gtkfqtcf"]} : ${${"GLOBALS"}["kdmkog"]};
                 }
             } else {
                 ${"GLOBALS"}["mejgkzpxfs"] = "value";
                 ${"GLOBALS"}["mehkcydynk"] = "data";
                 if (isset(${${"GLOBALS"}["iwnmlbb"]}["validate"]) && !Validate::${${"GLOBALS"}["iwnmlbb"]}["validate"](${${"GLOBALS"}["wfflirafolq"]}) && (!empty(${${"GLOBALS"}["mejgkzpxfs"]}) || isset(${${"GLOBALS"}["iwnmlbb"]}["required"]) && ${${"GLOBALS"}["mehkcydynk"]}["required"])) {
                     $vltxdvdq = "htmlentities";
                     ${"GLOBALS"}["bohkdrh"] = "errors";
                     $btpfmrdi = "data";
                     ${${"GLOBALS"}["bohkdrh"]}[] = "<b>" . ${$btpfmrdi}["validate"] . " " . self::displayFieldName(${${"GLOBALS"}["nsrqxdsfw"]}, get_class($this), ${$vltxdvdq}) . "</b> " . Tools::displayError("is invalid.");
                 } else {
                     ${"GLOBALS"}["susgffn"] = "data";
                     $ojhawnjc = "field";
                     ${"GLOBALS"}["ddnlvjvgd"] = "data";
                     if (isset(${${"GLOBALS"}["ddnlvjvgd"]}["copy_post"]) && !${${"GLOBALS"}["susgffn"]}["copy_post"]) {
                         continue;
                     }
                     $this->{${$ojhawnjc}} = ${${"GLOBALS"}["wfflirafolq"]};
                 }
             }
         }
     }
     return ${${"GLOBALS"}["xgynkihlk"]};
 }
예제 #15
0
 protected function processSubmitSellerinfo()
 {
     ${"GLOBALS"}["ffnxcnlg"] = "id_paymentinfo_paypal";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${"GLOBALS"}["frvqikxjd"] = "paypal_inuse";
     $wcqfvynoolh = "id_paymentinfo_cod";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/AgileSellerPaymentInfo.php";
     ${${"GLOBALS"}["ztmujejepnz"]} = new SellerInfo(SellerInfo::getIdByCustomerId(self::$cookie->id_customer), self::$cookie->id_lang);
     if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilepaypal", $sellerinfo->id_seller, Tools::getValue("paypal_email"))) {
         $this->errors[] = Tools::displayError("The paypal account email has been used by another seller.");
     }
     ${"GLOBALS"}["uohljc"] = "id_paymentinfo_paypal";
     ${"GLOBALS"}["oxhfxn"] = "paypal_emailaddress";
     ${${"GLOBALS"}["oxhfxn"]} = Tools::getValue("paypal_email");
     ${"GLOBALS"}["yxiqwgdbl"] = "paymentinfo_paypal";
     ${${"GLOBALS"}["frvqikxjd"]} = (int) Tools::getValue("paypal_in_use");
     if ((${${"GLOBALS"}["zmendemfxetq"]} || !empty(${${"GLOBALS"}["wkdsijnbhw"]})) && !Validate::isEmail(${${"GLOBALS"}["wkdsijnbhw"]})) {
         $this->errors[] = Tools::displayError("The paypal account email is invalid.");
     }
     if (!empty($this->errors)) {
         return;
     }
     ${"GLOBALS"}["gzxrhutccoo"] = "cod_notes";
     ${${"GLOBALS"}["uohljc"]} = intval(Tools::getValue("id_paymentinfo_paypal"));
     if (${${"GLOBALS"}["ffnxcnlg"]} > 0) {
         ${${"GLOBALS"}["yxiqwgdbl"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["xcjjpktqh"]});
     } else {
         ${${"GLOBALS"}["hwlygpy"]} = new AgileSellerPaymentInfo();
         $paymentinfo_paypal->id = 0;
         $paymentinfo_paypal->id_currency = 0;
     }
     $paymentinfo_paypal->id_seller = $sellerinfo->id_seller;
     ${"GLOBALS"}["urxswawvr"] = "paymentinfo_cod";
     $paymentinfo_paypal->module_name = "agilepaypal";
     $paymentinfo_paypal->info1 = Tools::getValue("paypal_email");
     $paymentinfo_paypal->in_use = Tools::getValue("paypal_in_use");
     $paymentinfo_paypal->save();
     ${${"GLOBALS"}["gzxrhutccoo"]} = Tools::getValue("cod_notes");
     ${${"GLOBALS"}["ybifkiqb"]} = (int) Tools::getValue("cod_in_use");
     ${$wcqfvynoolh} = intval(Tools::getValue("id_paymentinfo_cod"));
     if (${${"GLOBALS"}["nmyqlkttxp"]} > 0) {
         ${${"GLOBALS"}["urxswawvr"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["xcjjpktqh"]});
     } else {
         $wgvhvlphcwd = "paymentinfo_cod";
         ${$wgvhvlphcwd} = new AgileSellerPaymentInfo();
         $paymentinfo_cod->id = 0;
     }
     $paymentinfo_cod->id_seller = $sellerinfo->id_seller;
     $paymentinfo_cod->module_name = "agilecashondelivery";
     $paymentinfo_cod->info1 = Tools::getValue("cod_notes");
     $paymentinfo_cod->in_use = Tools::getValue("cod_in_use");
     $paymentinfo_cod->save();
     if (Module::isInstalled("agilegooglecheckout")) {
         $dtrinzc = "id_paymentinfo_gcheckout";
         if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilegooglecheckout", $sellerinfo->id_seller, Tools::getValue("gcheckout_merchant_id"))) {
             $this->errors[] = Tools::displayError("The google checkout account has been used by another seller.");
             return;
         }
         $pcyquknfjc = "id_paymentinfo_gcheckout";
         $yucskmiujsn = "paymentinfo_gcheckout";
         ${$dtrinzc} = intval(Tools::getValue("id_paymentinfo_gcheckout"));
         if (${$pcyquknfjc} > 0) {
             ${$yucskmiujsn} = new AgileSellerPaymentInfo(${${"GLOBALS"}["rmpumsc"]});
         } else {
             ${${"GLOBALS"}["hocodd"]} = new AgileSellerPaymentInfo();
             $paymentinfo_gcheckout->id = 0;
             $paymentinfo_gcheckout->id_currency = 0;
         }
         $paymentinfo_gcheckout->id_seller = $sellerinfo->id_seller;
         $paymentinfo_gcheckout->module_name = "googlecheckout";
         $paymentinfo_gcheckout->info1 = Tools::getValue("gcheckout_merchant_id");
         $paymentinfo_gcheckout->info2 = Tools::getValue("gcheckout_key");
         $paymentinfo_gcheckout->in_use = Tools::getValue("gcheckout_in_use");
         $paymentinfo_gcheckout->save();
     }
     if (Module::isInstalled("agilebankwire")) {
         $sefhkjfq = "paymentinfo_bankwire";
         ${"GLOBALS"}["udeoyndd"] = "id_paymentinfo_bankwire";
         ${${"GLOBALS"}["nxbcvt"]} = intval(Tools::getValue("id_paymentinfo_bankwire"));
         if (${${"GLOBALS"}["udeoyndd"]} > 0) {
             ${$sefhkjfq} = new AgileSellerPaymentInfo(${${"GLOBALS"}["nxbcvt"]});
         } else {
             ${"GLOBALS"}["wkjndne"] = "paymentinfo_bankwire";
             ${${"GLOBALS"}["wkjndne"]} = new AgileSellerPaymentInfo();
             $paymentinfo_bankwire->id = 0;
             $paymentinfo_bankwire->id_currency = 0;
         }
         $paymentinfo_bankwire->id_seller = $sellerinfo->id_seller;
         $paymentinfo_bankwire->module_name = "bankwire";
         $paymentinfo_bankwire->info1 = Tools::getValue("bankwire_accountowner");
         $paymentinfo_bankwire->info2 = Tools::getValue("bankwire_accountdetails");
         $paymentinfo_bankwire->info3 = Tools::getValue("bankwire_bankaddress");
         $paymentinfo_bankwire->in_use = Tools::getValue("bankwire_in_use");
         $paymentinfo_bankwire->save();
     }
     if (Module::isInstalled("agilepaybycheque")) {
         $yjttwrr = "id_paymentinfo_agilepaybycheque";
         ${"GLOBALS"}["ysarmtdkwo"] = "id_paymentinfo_agilepaybycheque";
         ${$yjttwrr} = intval(Tools::getValue("id_paymentinfo_agilepaybycheque"));
         if (${${"GLOBALS"}["ysarmtdkwo"]} > 0) {
             ${${"GLOBALS"}["swrqbqopsma"]} = new AgileSellerPaymentInfo(${${"GLOBALS"}["gqrxkgtct"]});
         } else {
             $brrgvkf = "paymentinfo_agilepaybycheque";
             ${$brrgvkf} = new AgileSellerPaymentInfo();
             $paymentinfo_agilepaybycheque->id = 0;
             $paymentinfo_agilepaybycheque->id_currency = 0;
         }
         $paymentinfo_agilepaybycheque->id_seller = $sellerinfo->id_seller;
         $paymentinfo_agilepaybycheque->module_name = "agilepaybycheque";
         $paymentinfo_agilepaybycheque->info1 = Tools::getValue("agilepaybycheque_paytoname");
         $paymentinfo_agilepaybycheque->info2 = Tools::getValue("agilepaybycheque_address");
         $paymentinfo_agilepaybycheque->in_use = Tools::getValue("agilepaybycheque_in_use");
         $paymentinfo_agilepaybycheque->save();
     }
     if (empty($this->errors)) {
         self::$smarty->assign("cfmmsg_flag", 1);
     }
 }
 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"]}));
 }
예제 #17
0
 public static function get_current_logged_seller_home_category_id()
 {
     if (!Module::isInstalled('agilemultipleseller')) {
         return 0;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_seller = AgileSellerManager::current_logged_seller_id();
     if ($id_seller <= 0) {
         return 0;
     }
     $sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId($id_seller));
     if ($sellerinfo->id_category_default <= 2) {
         return 0;
     }
     $category = new Category($sellerinfo->id_category_default, Context::getContext()->language->id);
     if (!Validate::isLoadedObject($category)) {
         return 0;
     }
     return $sellerinfo->id_category_default;
 }
예제 #18
0
 public function getAgileSellerLink($id_seller, $alias = NULL, $id_lang = NULL)
 {
     if (!$id_seller) {
         return '';
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId($id_seller));
     $id_shopurl = Shop::get_main_url_id($sellerinfo->id_shop);
     $shopurl = new ShopUrl($id_shopurl);
     $url = $shopurl->getURL() . $this->getLangLink();
     if (Module::IsInstalled('agilemultipleshop')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php";
         if ((int) Configuration::get('ASP_SHOP_URL_MODE') == AgileMultipleShop::SHOP_URL_MODE_DOMAIN) {
             return $url;
         }
     }
     if ($this->allow) {
         return $url;
     } else {
         return _PS_BASE_URL_SSL_ . __PS_BASE_URI__ . 'index.php?controller=agileseller&id_seller=' . (int) $id_seller;
     }
 }
예제 #19
0
 public static function sendSellerReply($operator_name)
 {
     ${"GLOBALS"}["cshohjjk"] = "iso";
     ${"GLOBALS"}["fdlwtqqqf"] = "iso";
     global $cookie;
     ${"GLOBALS"}["lviroybng"] = "id_seller";
     ${"GLOBALS"}["igmievrmx"] = "id_lang";
     ${"GLOBALS"}["enihlibywlot"] = "reply_message";
     $vgyzbncx = "org_message";
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${"GLOBALS"}["zymlumtphs"] = "templateVars";
     ${${"GLOBALS"}["zoconsk"]} = array();
     $rjegfmvgr = "reply_message";
     ${${"GLOBALS"}["inowumm"]} = Tools::getValue("reply_message");
     $gjcdjbfwkqvf = "seller_email";
     if (empty(${${"GLOBALS"}["enihlibywlot"]})) {
         ${${"GLOBALS"}["zoconsk"]}[] = $this->l('Reply message cannot be empty.');
         return;
     }
     ${"GLOBALS"}["ztpgzxclyfb"] = "errs";
     ${$vgyzbncx} = new AgileSellerMessage(Tools::getValue("id_agile_sellermessage"));
     $kwzbnnrr = "id_lang";
     ${${"GLOBALS"}["ihicvjpboh"]} = intval($org_message->id_seller);
     ${"GLOBALS"}["fsjcnwaxxhr"] = "hide_email";
     ${"GLOBALS"}["jbxgznhslu"] = "template";
     if (${${"GLOBALS"}["lviroybng"]} > 0) {
         $sbnxtyxkjnx = "sellerinfo";
         ${$sbnxtyxkjnx} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["ihicvjpboh"]}), $cookie->id_lang);
         ${${"GLOBALS"}["gytphbi"]} = new Customer($sellerinfo->id_customer);
         ${${"GLOBALS"}["ugiotrapn"]} = $sellerlnkedcustomer->email;
         ${${"GLOBALS"}["ushosrbo"]} = $sellerinfo->company;
     } else {
         ${${"GLOBALS"}["ushosrbo"]} = Configuration::get("PS_SHOP_NAME");
         ${${"GLOBALS"}["ugiotrapn"]} = Configuration::get("PS_SHOP_EMAIL");
     }
     ${"GLOBALS"}["ybslviw"] = "seller_email";
     $ottsxpce = "seller_name";
     ${${"GLOBALS"}["onxgkz"]} = Configuration::get("ASMGER_DONOTREPLY_EMAIL");
     ${${"GLOBALS"}["swryjfvdb"]} = intval(Configuration::get("ASMGER_HIDE_EMAIL"));
     $nscqkytpjk = "iso";
     if (${${"GLOBALS"}["fsjcnwaxxhr"]}) {
         ${${"GLOBALS"}["hwmgcsiehbfr"]} = ${${"GLOBALS"}["onxgkz"]};
     } else {
         ${${"GLOBALS"}["hwmgcsiehbfr"]} = ${$gjcdjbfwkqvf};
     }
     $hmzkqcfovg = "reply_message";
     $svgguicotfu = "reply_message";
     ${$svgguicotfu} .= "\n";
     $dlenxnyvmyu = "lines";
     ${${"GLOBALS"}["iztfep"]} = explode("\n", $org_message->message);
     ${"GLOBALS"}["zkoocbisnhs"] = "template";
     foreach (${$dlenxnyvmyu} as ${${"GLOBALS"}["zguejsolol"]}) {
         ${${"GLOBALS"}["inowumm"]} .= ">" . ${${"GLOBALS"}["zguejsolol"]} . "\n";
     }
     ${${"GLOBALS"}["jbxgznhslu"]} = "mtocustomer";
     ${${"GLOBALS"}["zymlumtphs"]} = array("{seller_name}" => ${$ottsxpce}, "{shop_name}" => Configuration::get("PS_SHOP_NAME"), "{shop_url}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, "{message}" => str_replace("\n", "<br />", ${$rjegfmvgr}));
     ${$kwzbnnrr} = $cookie->id_lang;
     ${${"GLOBALS"}["vqsvjvnyrtt"]} = $org_message->subject;
     ${${"GLOBALS"}["cshohjjk"]} = Language::getIsoById((int) ${${"GLOBALS"}["igmievrmx"]});
     if (file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["fdlwtqqqf"]} . "/" . ${${"GLOBALS"}["zkoocbisnhs"]} . ".txt") and file_exists(dirname(__FILE__) . "/mails/" . ${$nscqkytpjk} . "/" . ${${"GLOBALS"}["ppciqc"]} . ".html")) {
         $cftdlqfrba = "template";
         $pbsuncwqd = "templateVars";
         $gbitnvysv = "from_email";
         ${"GLOBALS"}["ftaxgwkbr"] = "seller_name";
         $kpemrmhpv = "from_email";
         $dqleqikft = "subject";
         Mail::Send(${${"GLOBALS"}["ohoeks"]}, ${${"GLOBALS"}["ppciqc"]}, ${${"GLOBALS"}["vqsvjvnyrtt"]}, ${${"GLOBALS"}["rndqhylugl"]}, $org_message->from_email, NULL, ${$kpemrmhpv}, ${${"GLOBALS"}["ftaxgwkbr"]}, NULL, NULL, dirname(__FILE__) . "/mails/");
         if (intval(Configuration::get("ASMGER_EMAIL_COPYADMIN")) > 0) {
             Mail::Send(${${"GLOBALS"}["ohoeks"]}, ${$cftdlqfrba}, ${$dqleqikft}, ${$pbsuncwqd}, Configuration::get("PS_SHOP_EMAIL"), NULL, ${$gbitnvysv}, ${${"GLOBALS"}["ushosrbo"]}, NULL, NULL, dirname(__FILE__) . "/mails/");
         }
     }
     ${${"GLOBALS"}["agnwbbnejad"]} = new AgileSellerMessage($org_message->id);
     $message->id = 0;
     $message->is_customer_message = 0;
     $message->ip_address = $_SERVER["REMOTE_ADDR"];
     $message->from_email = ${${"GLOBALS"}["ybslviw"]};
     $message->from_name = ${${"GLOBALS"}["ushosrbo"]};
     $message->message = ${$hmzkqcfovg};
     if (intval(Configuration::get("ASMGER_APPROVAL_REQUIRED"))) {
         $message->active = 0;
     } else {
         $message->active = 1;
     }
     ${"GLOBALS"}["etuzzhts"] = "reply_message";
     $message->message = ${${"GLOBALS"}["etuzzhts"]};
     $message->save();
     return ${${"GLOBALS"}["ztpgzxclyfb"]};
 }
예제 #20
0
 public function processSave()
 {
     AgileMultipleSeller::ensure_date_custom_field();
     $this->object = $this->loadObject();
     $this->errors = array_merge($this->errors, $this->object->validateController());
     $this->object->save();
     SellerInfo::processLogoUpload($this->object);
 }
 protected function getSellers($filter, $loclevel, $seller_location, $parentid, $seller_type, $nb_only = false, $p = 1, $n = 10)
 {
     $kkogupccdhb = "n";
     $pkeqzkyiwg = "filter";
     $vuksqrvbb = "p";
     $fmudhbweowv = "n";
     ${"GLOBALS"}["tpuyuglez"] = "filter";
     global $cookie;
     if (${${"GLOBALS"}["dnjxlkemh"]} < 1) {
         ${$vuksqrvbb} = 1;
     }
     $ngvwirzrfke = "seller_type";
     ${"GLOBALS"}["xjmyxplqv"] = "sql";
     ${"GLOBALS"}["jiccurkf"] = "idx";
     if (${$fmudhbweowv} < 1) {
         ${${"GLOBALS"}["vhsixjirton"]} = 10;
     }
     $yzmtckn = "n";
     if (strtoupper(${$pkeqzkyiwg}) == "ALL") {
         ${${"GLOBALS"}["yrvgkjhsvn"]} = "";
     }
     $cpfozsi = "filter";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${${"GLOBALS"}["hfizsmyzc"]} = "FROM `" . _DB_PREFIX_ . "employee` e\n                     LEFT JOIN  `" . _DB_PREFIX_ . "sellerinfo` s ON e.id_employee = s.id_seller\n                     LEFT JOIN  `" . _DB_PREFIX_ . "sellerinfo_lang` sl ON s.id_sellerinfo=sl.id_sellerinfo AND sl.id_lang = " . $cookie->id_lang . "\n                     LEFT JOIN (SELECT count(*) as products,id_owner FROM " . _DB_PREFIX_ . "product_owner po1 LEFT JOIN " . _DB_PREFIX_ . "product p1 on(p1.id_product=po1.id_product) WHERE p1.active=1 GROUP BY id_owner) p ON e.id_employee=p.id_owner\n                     LEFT JOIN  `" . _DB_PREFIX_ . "country_lang` cl ON (s.id_country = cl.id_country AND cl.id_lang=" . (int) $cookie->id_lang . ")\n                     LEFT JOIN  `" . _DB_PREFIX_ . "state` st ON s.id_state = st.id_state\n                 WHERE e.active=1 \n                    AND e.id_profile = " . Configuration::get("AGILE_MS_PROFILE_ID") . "\n                 ";
     if (!empty(${$cpfozsi})) {
         ${${"GLOBALS"}["hfizsmyzc"]} = ${${"GLOBALS"}["hfizsmyzc"]} . " AND sl.company like '" . ${${"GLOBALS"}["tpuyuglez"]} . "%'";
     }
     if (${${"GLOBALS"}["dhmgqmru"]} > 0) {
         ${${"GLOBALS"}["hfizsmyzc"]} = ${${"GLOBALS"}["xjmyxplqv"]} . " AND (s.id_sellertype1 = " . ${${"GLOBALS"}["dhmgqmru"]} . " OR s.id_sellertype2 = " . ${$ngvwirzrfke} . ")";
     }
     $njsrwx = "loclevel";
     ${"GLOBALS"}["wczwhpewofs"] = "p";
     ${"GLOBALS"}["ueccovehs"] = "idx";
     if (${${"GLOBALS"}["qdayfxgyolo"]} == "country") {
         $brksdpu = "sql";
         if (!empty(${${"GLOBALS"}["fikxfqrasp"]})) {
             ${$brksdpu} = ${${"GLOBALS"}["hfizsmyzc"]} . " AND s.id_country = " . intval(${${"GLOBALS"}["fikxfqrasp"]});
         }
     } else {
         if (${${"GLOBALS"}["qdayfxgyolo"]} == "state") {
             $ptmgmprnvnq = "seller_location";
             if (${${"GLOBALS"}["inoywq"]} > 0) {
                 ${${"GLOBALS"}["hfizsmyzc"]} = ${${"GLOBALS"}["hfizsmyzc"]} . " AND s.id_country = '" . ${${"GLOBALS"}["inoywq"]} . "'";
             }
             if (!empty(${$ptmgmprnvnq})) {
                 $qstkrnbfb = "sql";
                 $rmbwgxvdm = "seller_location";
                 ${${"GLOBALS"}["hfizsmyzc"]} = ${$qstkrnbfb} . " AND s.id_state = " . intval(${$rmbwgxvdm});
             }
         } else {
             if (${$njsrwx} == "city") {
                 if (${${"GLOBALS"}["inoywq"]} > 0) {
                     ${"GLOBALS"}["defcvsfnbfjm"] = "sql";
                     ${"GLOBALS"}["uvoktmkcmfd"] = "parentid";
                     ${${"GLOBALS"}["hfizsmyzc"]} = ${${"GLOBALS"}["defcvsfnbfjm"]} . " AND s.id_state = '" . ${${"GLOBALS"}["uvoktmkcmfd"]} . "'";
                 }
                 ${"GLOBALS"}["kiofppjfwr"] = "seller_location";
                 if (!empty(${${"GLOBALS"}["kiofppjfwr"]})) {
                     $mrqmpxsh = "sql";
                     ${$mrqmpxsh} = ${${"GLOBALS"}["hfizsmyzc"]} . " AND sl.city = '" . ${${"GLOBALS"}["fikxfqrasp"]} . "'";
                 }
             }
         }
     }
     if (${${"GLOBALS"}["pukknqg"]}) {
         $hzocsdrvh = "sql0";
         $jxqxbioqh = "sql";
         ${${"GLOBALS"}["hbrwvgrewxi"]} = "SELECT COUNT(*) " . ${$jxqxbioqh};
         return Db::getInstance()->getValue(${$hzocsdrvh});
     }
     ${${"GLOBALS"}["jkdmbkvfe"]} = "SELECT s.`id_sellerinfo`, s.`id_seller`, s.`id_country`, s.`id_state`, s.`postcode`, s.`phone`, s.`fax`, s.`latitude`, s.`longitude`, s.`date_add`, s.`date_upd`, s.`id_customer`, s.`dni`, s.`id_shop`, s.`id_category_default`, s.`id_sellertype1`, s.`id_sellertype2`,\n                        cl.name as country, st.name as state, sl.*, IFNULL(p.products,0) AS products " . ${${"GLOBALS"}["hfizsmyzc"]} . "   \n                    ORDER BY sl.company ASC\n                    LIMIT " . ((int) ${${"GLOBALS"}["wczwhpewofs"]} - 1) * (int) ${$yzmtckn} . "," . (int) ${$kkogupccdhb};
     ${${"GLOBALS"}["ajztkmhlf"]} = Db::getInstance()->ExecuteS(${${"GLOBALS"}["jkdmbkvfe"]});
     for (${${"GLOBALS"}["jiccurkf"]} = 0; ${${"GLOBALS"}["ueccovehs"]} < count(${${"GLOBALS"}["ajztkmhlf"]}); ${${"GLOBALS"}["usxshxp"]}++) {
         ${"GLOBALS"}["eeicqs"] = "sellerinfos";
         $orjoeecmnc = "sellerinfos";
         ${${"GLOBALS"}["eeicqs"]}[${${"GLOBALS"}["usxshxp"]}]["seller_logo_url"] = SellerInfo::get_seller_logo_url_static_sellers(${$orjoeecmnc}[${${"GLOBALS"}["usxshxp"]}]["id_sellerinfo"]);
     }
     return ${${"GLOBALS"}["ajztkmhlf"]};
 }
예제 #22
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');
    }
예제 #23
0
 protected function processSubmitSellerinfo()
 {
     $cugxxpwlfps = "firstname";
     ${"GLOBALS"}["gmnuknt"] = "lastname";
     $eoemtqhasop = "passwd";
     ${$cugxxpwlfps} = trim(Tools::getValue("firstname"));
     ${${"GLOBALS"}["gmnuknt"]} = trim(Tools::getValue("lastname"));
     $ufvrdeas = "customer";
     $seqgjbwpajto = "email";
     ${$eoemtqhasop} = trim(Tools::getValue("passwd"));
     ${${"GLOBALS"}["cyutgacgwj"]} = trim(Tools::getValue("email"));
     if (empty(${${"GLOBALS"}["efoxtmc"]})) {
         $this->errors[] = Tools::displayError("First name is required field.");
     }
     if (empty(${${"GLOBALS"}["ptvgwodrri"]})) {
         $this->errors[] = Tools::displayError("Last name is required field.");
     }
     ${"GLOBALS"}["yqbqcnmck"] = "email";
     ${"GLOBALS"}["utmvhz"] = "passwd";
     ${"GLOBALS"}["tgijpv"] = "country";
     if (empty(${$seqgjbwpajto})) {
         $this->errors[] = Tools::displayError("An email address required.");
     } elseif (!Validate::isEmail(${${"GLOBALS"}["yqbqcnmck"]})) {
         $this->errors[] = Tools::displayError("Invalid email address.");
     } elseif (empty(${${"GLOBALS"}["trolpj"]})) {
         $this->errors[] = Tools::displayError("Password is required.");
     } elseif (!Validate::isPasswd(${${"GLOBALS"}["utmvhz"]})) {
         $this->errors[] = Tools::displayError("Invalid password.");
     }
     if (Customer::customerExists(${${"GLOBALS"}["cyutgacgwj"]})) {
         $this->errors[] = Tools::displayError("An account using this email address has already been registered.", false);
     }
     if (empty($_POST["postcode"])) {
         $this->errors[] = Tools::displayError("Postcode is required field.");
     }
     ${"GLOBALS"}["hdrwdzkfjgu"] = "zip_code_format";
     $this->errors = array_merge($this->errors, $this->sellerinfo->validateController());
     if (!(${${"GLOBALS"}["tgijpv"]} = new Country($this->sellerinfo->id_country)) || !Validate::isLoadedObject(${${"GLOBALS"}["lqineuzwfyx"]})) {
         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.");
     }
     ${${"GLOBALS"}["hdrwdzkfjgu"]} = $country->zip_code_format;
     $mlynabrtypu = "firstname";
     if ($country->need_zip_code) {
         $pttheklyj = "zip_code_format";
         $rbigoogxf = "postcode";
         $eyigihyebms = "postcode";
         ${"GLOBALS"}["plwthxmbdlo"] = "zip_code_format";
         $cxtukbkhyi = "postcode";
         if ((${$rbigoogxf} = Tools::getValue("postcode")) && ${${"GLOBALS"}["sjdohmx"]}) {
             ${"GLOBALS"}["svnohdsrl"] = "zip_code_format";
             ${"GLOBALS"}["izxvxdtqx"] = "zip_regexp";
             ${${"GLOBALS"}["izxvxdtqx"]} = "/^" . ${${"GLOBALS"}["sjdohmx"]} . "\$/ui";
             ${"GLOBALS"}["qrxaqqsef"] = "zip_regexp";
             ${"GLOBALS"}["sjdvshef"] = "zip_regexp";
             $tvchozgsi = "zip_regexp";
             ${"GLOBALS"}["ttwdyf"] = "zip_regexp";
             $vvtylsjtq = "postcode";
             ${"GLOBALS"}["ncdyrvfvd"] = "zip_regexp";
             ${$tvchozgsi} = str_replace(" ", "( |)", ${${"GLOBALS"}["ncdyrvfvd"]});
             ${"GLOBALS"}["jzxhhwlf"] = "zip_regexp";
             ${${"GLOBALS"}["sjdvshef"]} = str_replace("-", "(-|)", ${${"GLOBALS"}["rjvnbwy"]});
             ${${"GLOBALS"}["rjvnbwy"]} = str_replace("N", "[0-9]", ${${"GLOBALS"}["qrxaqqsef"]});
             ${${"GLOBALS"}["rjvnbwy"]} = str_replace("L", "[a-zA-Z]", ${${"GLOBALS"}["jzxhhwlf"]});
             ${${"GLOBALS"}["ttwdyf"]} = str_replace("C", $country->iso_code, ${${"GLOBALS"}["rjvnbwy"]});
             if (!preg_match(${${"GLOBALS"}["rjvnbwy"]}, ${$vvtylsjtq})) {
                 $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"}["svnohdsrl"]})));
             }
         } else {
             if (${$pttheklyj}) {
                 $this->errors[] = "<strong>" . Tools::displayError("Zip / Postal code") . "</strong> " . Tools::displayError("is required.");
             } else {
                 if (${$eyigihyebms} && !preg_match("/^[0-9a-zA-Z -]{4,9}\$/ui", ${$cxtukbkhyi})) {
                     $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"}["plwthxmbdlo"]})));
                 }
             }
         }
     }
     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");
     SellerInfo::processLogoUpload($this->sellerinfo);
     $this->errors = array_merge($this->errors, $this->sellerinfo->validateController());
     if (!empty($this->errors)) {
         return;
     }
     ${${"GLOBALS"}["rdkumopydcrd"]} = new Customer();
     $customer->firstname = ${$mlynabrtypu};
     $customer->lastname = ${${"GLOBALS"}["ptvgwodrri"]};
     $customer->email = ${${"GLOBALS"}["cyutgacgwj"]};
     $customer->is_guest = 1;
     $customer->active = 1;
     $lkenglu = "customer";
     if ($customer->add()) {
         if (!$this->sendConfirmationMail(${${"GLOBALS"}["rdkumopydcrd"]})) {
             $this->errors[] = Tools::displayError("The email cannot be sent.");
         }
     } else {
         $this->errors[] = Tools::displayError("Error during create a new customer account.");
         return;
     }
     $this->updateContext(${$ufvrdeas});
     Hook::exec("actionCustomerAccountAdd", array("_POST" => $_POST, "newCustomer" => ${$lkenglu}));
     if (empty($this->_errors)) {
         ${"GLOBALS"}["brdlwjleiw"] = "url";
         ${"GLOBALS"}["fnsbgq"] = "url";
         AgileMultipleSeller::createSellerAccount(${${"GLOBALS"}["rdkumopydcrd"]});
         ${${"GLOBALS"}["brdlwjleiw"]} = $this->context->link->getModuleLink("agilemultipleseller", "sellersignup", array(), true);
         Tools::redirect(${${"GLOBALS"}["fnsbgq"]});
     }
 }
 public static function sendNewProductEmail($id_product)
 {
     $xggjsvkh = "configuration";
     global $cookie;
     ${"GLOBALS"}["xbjyuoys"] = "temp_folder";
     ${"GLOBALS"}["vjxxjrtfrf"] = "id_lang";
     $xinjhagz = "id_product";
     ${$xggjsvkh} = Configuration::getMultiple(array("PS_SHOP_EMAIL", "PS_SHOP_NAME"));
     if (intval(Configuration::get("AGILE_MS_PRODUCT_APPROVAL")) != 1) {
         return;
     }
     $cqsinufwsm = "companyName";
     ${"GLOBALS"}["okfxuwdv"] = "product";
     ${${"GLOBALS"}["cloygkl"]} = new Product(${${"GLOBALS"}["jcoawuufl"]}, false, $cookie->id_lang);
     $etqhqhju = "employee";
     ${${"GLOBALS"}["qdndcj"]} = AgileSellerManager::getObjectOwnerID("product", ${$xinjhagz});
     ${"GLOBALS"}["ysdqyel"] = "employee";
     $xmedjmaw = "iso";
     ${"GLOBALS"}["nuyqlbamq"] = "companyName";
     $uvjwwq = "sellerinfo";
     ${${"GLOBALS"}["ysdqyel"]} = new Employee(${${"GLOBALS"}["qdndcj"]});
     $jlkaces = "temp_folder";
     if (!Validate::isLoadedObject(${$etqhqhju}) or !Validate::isLoadedObject(${${"GLOBALS"}["okfxuwdv"]})) {
         return;
     }
     $ghlvsitdsd = "iso";
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${$uvjwwq} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["qdndcj"]}), $cookie->id_lang);
     ${${"GLOBALS"}["xqwnedvrkeb"]} = $cookie->id_lang;
     ${$xmedjmaw} = Language::getIsoById(${${"GLOBALS"}["vjxxjrtfrf"]});
     ${${"GLOBALS"}["xipiacxo"]} = $sellerinfo->company;
     if (empty(${${"GLOBALS"}["nuyqlbamq"]})) {
         ${${"GLOBALS"}["xipiacxo"]} = $employee->firstName + $employee->lastName;
     }
     ${${"GLOBALS"}["tkxwrio"]} = array("{seller_company}" => ${$cqsinufwsm}, "{seller_id}" => $employee->id, "{product_name}" => $product->name, "{product_id}" => $product->id, "{shop_name}" => Configuration::get("PS_SHOP_NAME"), "{shop_url}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, "{shop_logo}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . "img/logo.jpg");
     ${"GLOBALS"}["tzzidbejopm"] = "temp_folder";
     ${$jlkaces} = _PS_ROOT_DIR_ . "/modules/agilemultipleseller/mails/";
     if (!file_exists(${${"GLOBALS"}["tzzidbejopm"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.txt") or !file_exists(${${"GLOBALS"}["xbjyuoys"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.html")) {
         $hmfysdpkb = "iso";
         ${"GLOBALS"}["nzwsvuszmn"] = "id_lang";
         ${${"GLOBALS"}["xqwnedvrkeb"]} = (int) Configuration::get("PS_LANG_DEFAULT");
         ${$hmfysdpkb} = Language::getIsoById(${${"GLOBALS"}["nzwsvuszmn"]});
     }
     if (file_exists(${${"GLOBALS"}["qrcgvjrrwwd"]} . ${$ghlvsitdsd} . "/new_product.txt") and file_exists(${${"GLOBALS"}["qrcgvjrrwwd"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.html")) {
         $pnpqspg = "id_lang";
         $eoeoxctjohan = "configuration";
         $ghasalo = "templateVars";
         $folgfpf = "configuration";
         AgileMultipleSellerMailer::SendTranslateSubject(${$pnpqspg}, "new_product", ${$ghasalo}, ${$folgfpf}["PS_SHOP_EMAIL"], "Administrator", ${${"GLOBALS"}["hhrxtypttw"]}["PS_SHOP_EMAIL"], ${$eoeoxctjohan}["PS_SHOP_NAME"], NULL, NULL, ${${"GLOBALS"}["qrcgvjrrwwd"]});
     }
 }
예제 #25
0
	            ';
                break;
            case 'state':
                /*$sql = 'SELECT distinct s.id_state AS id, s.name AS name 
		            FROM `'._DB_PREFIX_.'state` s
		                INNER JOIN `'._DB_PREFIX_.'sellerinfo` si ON s.id_state = si.id_state
예제 #26
0
 public static function get_current_logged_seller_home_category_id()
 {
     if (!Module::isInstalled("agilemultipleseller")) {
         return 0;
     }
     ${"GLOBALS"}["pzvnnqi"] = "id_seller";
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${${"GLOBALS"}["tpubctvvlkrd"]} = AgileSellerManager::current_logged_seller_id();
     if (${${"GLOBALS"}["pzvnnqi"]} <= 0) {
         return 0;
     }
     ${${"GLOBALS"}["qwrpbc"]} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["tpubctvvlkrd"]}));
     if ($sellerinfo->id_category_default <= 2) {
         return 0;
     }
     ${${"GLOBALS"}["ykrvqmx"]} = new Category($sellerinfo->id_category_default, Context::getContext()->language->id);
     if (!Validate::isLoadedObject(${${"GLOBALS"}["ykrvqmx"]})) {
         return 0;
     }
     return $sellerinfo->id_category_default;
 }
예제 #27
0
 public static function init_shop_header()
 {
     ${"GLOBALS"}["beinhxxlt"] = "main_shop";
     ${${"GLOBALS"}["beinhxxlt"]} = 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::${${"GLOBALS"}["szjrqgvet"]}, "seller_logo_url" => isset(Shop::${${"GLOBALS"}["xfvfjfd"]}) ? SellerInfo::get_seller_logo_url_static(Shop::$sellerinfo->id) : ""));
 }
예제 #28
-1
파일: Shop.php 프로젝트: evilscripts/gy
 public static function initialize()
 {
     global $cookie;
     $shop = parent::initialize();
     if (Module::isInstalled('agilemultipleseller') and Module::isInstalled('agilemultipleshop') and $shop->id > 1) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleshop/agilemultipleshop.php";
         self::$id_shop_owner = AgileSellerManager::getSellerIdByShopId($shop->id);
         self::$id_shop_virtual = $shop->id;
         self::$sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId(self::$id_shop_owner));
         $shop->id = Configuration::get('PS_SHOP_DEFAULT');
         self::$context_id_shop = $shop->id;
     }
     return $shop;
 }