Ejemplo n.º 1
0
 public function initContent()
 {
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         $module = new AgileMultipleSeller();
         if (!$this->is_seller) {
             $this->displayWarning($module->getL('How To Create Seller Hint'));
         }
     }
     parent::initContent();
 }
Ejemplo n.º 2
0
 public function processData()
 {
     if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) {
         if (!Validate::isLoadedObject($this->seller)) {
             $this->errors[] = Tools::displayError('Seller does not exist');
         } elseif (!$this->seller->active) {
             self::$smarty->assign('seller', $this->seller);
         } else {
             $rewrited_url = self::$link->getAgileSellerLink((int) $this->seller->id, $this->getSellerLinkRwrite());
             $this->seller_info->description = _PS_VERSION_ > '1.5' ? Tools::nl2br($this->seller_info->description) : nl2br2($this->seller_info->description);
             self::$smarty->assign('seller', $this->seller);
             self::$smarty->assign('seller_info', $this->seller_info);
             $sellermodule = new AgileMultipleSeller();
             $conf = Configuration::getMultiple($sellermodule->getCustomFields());
             $custom_labels = $sellermodule->getCustomLabels();
             self::$smarty->assign('conf', $conf);
             self::$smarty->assign('custom_labels', $custom_labels);
             $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', ">=");
             $HOOK_SELLER_RATINGS = '';
             if (Module::isInstalled('agilesellerratings')) {
                 require_once _PS_ROOT_DIR_ . "/modules/agilesellerratings/agilesellerratings.php";
                 $rmodule = new AgileSellerRatings();
                 $HOOK_SELLER_RATINGS = $rmodule->getAverageRating($this->id_seller, AgileSellerRatings::RATING_TYPE_SELLER);
             }
             self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'id_seller' => (int) $this->seller->id, 'path' => $this->seller_info->company, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . "/modules/agilesellerproducts/", 'agilemultipleshop_tpl' => _PS_ROOT_DIR_ . "/modules/agilemultipleshop/", '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'), 'HOOK_SELLER_RATINGS' => $HOOK_SELLER_RATINGS, 'page_name' => 'agileseller'));
             $ver = (int) str_replace(".", "", _PS_VERSION_);
             if ($ver <= 1430) {
             } else {
                 if ($ver <= 1451) {
                     if (isset(self::$cookie->id_customer)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer));
                     } elseif (isset(self::$cookie->id_guest)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest));
                     }
                 } else {
                     if (isset(self::$cookie->id_compare)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare));
                     }
                 }
             }
         }
         self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
     }
 }
Ejemplo n.º 3
0
 public function postProcess()
 {
     $this->context->smarty->assign(array("cfmmsg_flag" => Tools::getValue("cfmmsg_flag")));
     if (Tools::isSubmit("submitSellerAccount")) {
         AgileMultipleSeller::createSellerAccount(new Customer(self::$cookie->id_customer));
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "B2T") {
         $zbdpzet = "errmsg";
         ${${"GLOBALS"}["uswhdzhd"]} = AgileMultipleSeller::convert_balance_to_token(self::$cookie->id_customer, (double) Tools::getValue("amount_to_convert"), $this->l('CHANGE BALANCE TO TOKENS'));
         if (!empty(${$zbdpzet})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "MPR") {
         ${${"GLOBALS"}["uswhdzhd"]} = AgileMultipleSeller::make_fund_request(self::$cookie->id_customer, (double) Tools::getValue("amount_to_convert"), $this->l('MAKE FUND REQUEST'));
         if (!empty(${${"GLOBALS"}["uswhdzhd"]})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
     if (Tools::getValue("submitRequest") == "T2B") {
         ${"GLOBALS"}["jjycov"] = "errmsg";
         ${${"GLOBALS"}["jjycov"]} = AgileMultipleSeller::convert_tokens_to_balance(self::$cookie->id_customer, (double) Tools::getValue("tokens_to_convert"), $this->l('CHANGE TOKENS TO BALANCE'));
         if (!empty(${${"GLOBALS"}["uswhdzhd"]})) {
             $this->errors[] = ${${"GLOBALS"}["uswhdzhd"]};
             return;
         }
         Tools::redirect(self::$link->getModuleLink("agilemultipleseller", "sellersummary", array("cfmmsg_flag" => 1), true));
     }
 }
Ejemplo n.º 4
0
 public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null)
 {
     global $defaultCountry;
     if (!Module::isInstalled('agilesellershipping') or !Module::isInstalled('agilemultipleseller')) {
         return parent::getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list, $id_zone);
     }
     $order_total = $this->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING);
     if ($order_total <= 0 and !(int) self::getNbProducts($this->id)) {
         return 0;
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
     include_once _PS_ROOT_DIR_ . "/modules/agilesellershipping/SellerShipping.php";
     $sellers = AgileMultipleSeller::getSellersByCart($this->id);
     if (empty($sellers)) {
         return parent::getPackageShippingCost($id_carrier, $use_tax, $default_country, $product_list, $id_zone);
     }
     if (isset($this->id_address_delivery) and $this->id_address_delivery and Customer::customerHasAddress($this->id_customer, $this->id_address_delivery)) {
         $id_zone = Address::getZoneById((int) $this->id_address_delivery);
     } else {
         if (!Validate::isLoadedObject($defaultCountry)) {
             $defaultCountry = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT'));
         }
         $id_zone = (int) $defaultCountry->id_zone;
     }
     $shipping_cost = 0;
     foreach ($sellers as $seller) {
         $seller_cost = $this->getOrderShippingCostPerSeller($id_zone, intval($seller['id_seller']), $use_tax);
         $shipping_cost += $seller_cost;
     }
     return $shipping_cost;
 }
Ejemplo n.º 5
0
 private function listAllowed()
 {
     global $smarty;
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         $id_owner = AgileSellerManager::getObjectOwnerID('product', Tools::getValue('id_product'));
         $smarty->assign(array('id_seller' => $id_owner));
         if ($id_owner > 0) {
             if (intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')) == 1) {
                 $approved = AgileMultipleSeller::is_list_approved(Tools::getValue('id_product'));
                 if ($approved != 1) {
                     return false;
                 }
             }
             if (Module::isInstalled('agilesellerlistoptions')) {
                 include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
                 $listoption = AgileSellerListOptions::get_product_list_option(Tools::getValue('id_product'), AgileSellerListOptions::ASLO_OPTION_LIST);
                 $liststatus = intval($listoption['status']);
                 $aslo_list_prod_id = intval(Configuration::get('ASLO_PROD_FOR_OPTION' . AgileSellerListOptions::ASLO_OPTION_LIST));
                 if ($liststatus != AgileSellerListOptions::ASLO_STATUS_IN_EFFECT && $aslo_list_prod_id != AgileSellerListOptions::ASLO_ALWAYS_FREE) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
 public function render($data = NULL)
 {
     $html = parent::render($data);
     if (Module::isInstalled('agilemultipleseller') and !(int) Configuration::get('AGILE_MS_ALLOW_REGISTER_ATHOME')) {
         $context = Context::getContext();
         if ((int) $context->cookie->id_employee == 0 or (int) $context->cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
             require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
             $html .= AgileMultipleSeller::jsForHideHome();
         }
     }
     return $html;
 }
Ejemplo n.º 7
0
 public function renderCategoryTree($root = null, $selected_cat = array(), $input_name = 'categoryBox', $use_radio = false, $use_search = false, $disabled_categories = array(), $use_in_popup = false, $use_shop_context = false)
 {
     global $cookie;
     $html = parent::renderCategoryTree($root, $selected_cat, $input_name, $use_radio, $use_search, $disabled_categories, $use_in_popup, $use_shop_context);
     if (Module::isInstalled('agilemultipleseller') and !(int) Configuration::get('AGILE_MS_ALLOW_REGISTER_ATHOME')) {
         if ((int) $cookie->id_employee == 0 or (int) $cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
             require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
             $html .= AgileMultipleSeller::jsForHideHome();
         }
     }
     return $html;
 }
 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 . ')';
         }
     }
 }
Ejemplo n.º 9
0
 public function initContent()
 {
     $this->context->smarty->assign(array('agilemultipleseller_isinstalled' => Module::isInstalled('agilemultipleseller') ? 1 : 0, 'agilesellerlistoptions_isinstalled' => Module::isInstalled('agilesellerlistoptions') ? 1 : 0, 'id_first_available_category' => AgileHelper::GetFirstAvailableCategory()));
     if (Module::isInstalled('agilemultipleseller')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/agilemultipleseller.php';
         require_once _PS_ROOT_DIR_ . '/modules/agilemultipleseller/SellerInfo.php';
         $this->context->smarty->assign(array('agilemultipleseller_hook' => _PS_ROOT_DIR_ . "/modules/agilemultipleseller/views/templates/hook/", 'is_seller' => $this->is_seller, 'id_seller' => AgileSellerManager::getObjectOwnerID($this->table, Tools::getValue('id_' . $this->table)), 'sellers' => $this->is_seller ? null : AgileSellerManager::getSellersNV(true, $this->l('Public in store')), 'approveal_required' => intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')), 'approved' => AgileMultipleSeller::is_list_approved(intval(Tools::getValue('id_product'))), 'ajx_category_url' => AgileMultipleSeller::get_agile_ajax_categories_url()));
     }
     if (Module::isInstalled('agilesellerlistoptions')) {
         require_once _PS_ROOT_DIR_ . '/modules/agilesellerlistoptions/agilesellerlistoptions.php';
         $aslo_module = new AgileSellerListOptions();
         $this->context->smarty->assign(array('agilesellerlistoptions_hook' => _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/views/templates/hook/", 'HOOK_PRODYCT_LIST_OPTIONS' => $aslo_module->hookAgileAdminProductsFormTop(array('for_front' => 0, 'id_product' => Tools::getValue('id_' . $this->table)), $this->is_seller)));
     }
     parent::initContent();
 }
 private function create_seller_account($object)
 {
     if ($this->is_seller or Tools::getValue('create_seller_account') <= 0) {
         return;
     }
     if (!Module::isInstalled('agilemultipleseller')) {
         return;
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_sellerinfo = SellerInfo::getIdByCustomerId($object->id);
     if ($id_sellerinfo > 0) {
         return;
     }
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
     AgileMultipleSeller::createSellerAccount($object);
 }
Ejemplo n.º 11
0
 public static function Send($id_lang, $template, $subject, $templateVars, $to, $toName = NULL, $from = NULL, $fromName = NULL, $fileAttachment = NULL, $modeSMTP = NULL, $templatePath = _PS_MAIL_DIR_, $die = false, $id_shop = NULL, $bcc = null)
 {
     if (Module::isInstalled('agileprepaidcredit') and $template == 'payment_error') {
         if (AgilePrepaidCredit::isPaymentErrorCausedByTokens($templateVars) > 0) {
             return true;
         }
     }
     $order_info_templates = array('order_conf', 'bankwire', 'cheque', 'new_order');
     if (Module::isInstalled('agilesellershipping') and in_array($template, $order_info_templates)) {
         AgileSellerManager::adjust_shipping_cost_carriers($templateVars);
     }
     if (Module::isInstalled('agilepickupcenter') and $template == 'order_conf') {
         require_once _PS_ROOT_DIR_ . "/modules/agilepickupcenter/agilepickupcenter.php";
         $amodule = new AgilePickupCenter();
         $templateVars = $amodule->transform_mail_data($templateVars);
         if (isset($templateVars['{carrier_email}']) and Validate::isEmail($templateVars['{carrier_email}'])) {
             parent::Send($id_lang, $template, $subject, $templateVars, $templateVars['{carrier_email}'], $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
         }
     }
     if (in_array($template, $order_info_templates)) {
         $shop_email = Configuration::get('PS_SHOP_EMAIL');
         if (Module::isInstalled('agilemultipleseller')) {
             require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
             $templateVars = AgileSellerManager::appendMailTemplateVars($templateVars, $id_lang);
         }
         if (Module::isInstalled('agileprepaidcredit') and in_array($template, array('bankwire', 'cheque'))) {
             require_once _PS_ROOT_DIR_ . "/modules/agileprepaidcredit/agileprepaidcredit.php";
             $templateVars = AgilePrepaidCredit::replace_amount2pay($templateVars);
         }
         parent::Send($id_lang, $template, $subject, $templateVars, $shop_email, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
     }
     if (Module::isInstalled('agilemultipleseller') and $template == 'order_customer_comment') {
         $id_order = intval($templateVars['{id_order}']);
         $id_seller = AgileSellerManager::getObjectOwnerID('order', $id_order);
         $seller = new Employee($id_seller);
         parent::Send($id_lang, $template, $subject, $templateVars, $seller->email, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
     }
     if (Module::isInstalled('agilemultipleseller') and $template == 'order_conf') {
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         AgileMultipleSeller::sendNewOrderMail($id_lang, $templateVars, $from, $fromName, $fileAttachment, $modeSMTP, $die, $id_shop, $bcc);
     }
     return parent::Send($id_lang, $template, $subject, $templateVars, $to, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
 }
Ejemplo n.º 12
0
 public function update($null_values = false)
 {
     $empInDb = new Employee($this->id);
     $result = parent::update($null_values);
     if (!$result) {
         return $result;
     }
     if (!Module::isInstalled('agilemultipleseller')) {
         return $result;
     }
     if ($empInDb->active == $this->active) {
         return $result;
     }
     if (!$this->active) {
         AgileSellerManager::disableSellerProducts($this->id);
     } else {
         if (intval(Configuration::get('AGILE_MS_SELLER_APPROVAL')) == 1) {
             require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
             AgileMultipleSeller::sendSellerAccountApprovalEmail($this->id);
         }
     }
     return $result;
 }
Ejemplo n.º 13
0
 public function validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod = 'Unknown', $message = NULL, $extraVars = array(), $currency_special = NULL, $dont_touch_amount = false, $secure_key = false, Shop $shop = null)
 {
     @session_start();
     @set_time_limit(120);
     $_SESSION['id_cart_validating'] = (int) $id_cart;
     if (Module::isInstalled('agileprepaidcredit')) {
         require_once _PS_ROOT_DIR_ . "/modules/agileprepaidcredit/agileprepaidcredit.php";
         AgilePrepaidCredit::set_token_payment_processing_marker($id_cart, true);
     }
     if (!Module::isInstalled('agilemultipleseller')) {
         $ret = parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key);
         if (Module::isInstalled('agileprepaidcredit')) {
             AgilePrepaidCredit::adjustOrderForTokens($this->currentOrder);
             if ($this->name == 'agilepaypalparallel' || ($this->name = 'agilepaypaladaptive')) {
                 AgilePrepaidCredit::checkOrderInvoicePayment($this->currentOrder);
             }
         }
         return $ret;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
     $paymode = (int) Configuration::get('AGILE_MS_PAYMENT_MODE');
     $sellers = AgileMultipleSeller::getSellersByCart($id_cart);
     if (count($sellers) <= 1) {
         $id_cart_patent = AgileMultipleSeller::get_subcart_parentid($id_cart);
         $ordervalided = parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key);
         $this->updateSellerCommissionRecordType($paymode, $message);
         if ($ordervalided and $id_cart_patent > 0) {
             AgileMultipleSeller::remove_subcart_items_from_maincart($id_cart, $this->currentOrder);
         }
         if (Module::isInstalled('agileprepaidcredit')) {
             AgilePrepaidCredit::adjustOrderForTokens($this->currentOrder);
             if ($this->name == 'agilepaypalparallel' || ($this->name = 'agilepaypaladaptive')) {
                 AgilePrepaidCredit::checkOrderInvoicePayment($this->currentOrder);
             }
         }
         return $ordervalided;
     }
     $cartinfos = AgileMultipleSeller::split_shopping_cart($id_cart, $sellers);
     if (empty($cartinfos)) {
         $ret = parent::validateOrder($id_cart, $id_order_state, $amountPaid, $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key);
         $this->updateSellerCommissionRecordType($paymode, $message);
         if (Module::isInstalled('agileprepaidcredit')) {
             AgilePrepaidCredit::adjustOrderForTokens($this->currentOrder);
             if ($this->name == 'agilepaypalparallel' || ($this->name = 'agilepaypaladaptive')) {
                 AgilePrepaidCredit::checkOrderInvoicePayment($this->currentOrder);
             }
         }
         return $ret;
     }
     $ret = true;
     foreach ($cartinfos as $cartinfo) {
         $_SESSION['id_cart_validating'] = (int) $cartinfo['id_cart'];
         $this->context->cart = new Cart(intval($cartinfo['id_cart']));
         $this->context->cart->getPackageList(true);
         $filter = CartRule::FILTER_ACTION_ALL;
         $cache_key = 'Cart::getCartRules' . $cartinfo['id_cart'] . '-' . $filter;
         if (Cache::isStored($cache_key)) {
             Cache::clean($cache_key);
         }
         if (Module::isInstalled('agileprepaidcredit')) {
             AgilePrepaidCredit::set_token_payment_processing_marker($cartinfo['id_cart'], true);
         }
         $ret = $ret and parent::validateOrder($cartinfo['id_cart'], $id_order_state, $cartinfo['amountPaid'], $paymentMethod, $message, $extraVars, $currency_special, $dont_touch_amount, $secure_key);
         $this->updateSellerCommissionRecordType($paymode, $message);
         if ($this->name == 'agilepaypalparallel') {
             $this->updateTxnDetailCartID($message, $this->currentOrder, $cartinfo['id_cart']);
         }
         if (Module::isInstalled('agileprepaidcredit')) {
             AgilePrepaidCredit::adjustOrderForTokens($this->currentOrder);
             if ($this->name == 'agilepaypalparallel' || ($this->name = 'agilepaypaladaptive')) {
                 AgilePrepaidCredit::adjustOrderPaymentAmount($this->currentOrder, $this->name);
                 AgilePrepaidCredit::checkOrderInvoicePayment($this->currentOrder);
             }
         }
     }
     return $ret;
 }
 public function stop_mix_handler()
 {
     global $cart;
     ${"GLOBALS"}["kosxrfmhilbe"] = "cart_products";
     if (!$this->active) {
         return true;
     }
     if (!Configuration::get("AGILE_MEDICAL_PRODUCT_CID")) {
         return true;
     }
     ${${"GLOBALS"}["kosxrfmhilbe"]} = $this->context->cart->getProducts();
     if (count(${${"GLOBALS"}["vburdiyeo"]}) > 0) {
         ${"GLOBALS"}["arvrpqpm"] = "isMedicalProduct";
         $fgtevqj = "isMedicalProduct";
         ${$fgtevqj} = AgileMultipleSeller::IsProductInMedicalCategory(Tools::getValue("id_product"));
         if (${${"GLOBALS"}["arvrpqpm"]} && (int) $cart->nbProducts() > 1) {
             return false;
         } else {
             $zxmlmbrnytk = "cart_product";
             foreach (${${"GLOBALS"}["vburdiyeo"]} as ${$zxmlmbrnytk}) {
                 ${${"GLOBALS"}["otiiwvldsekw"]} = ${${"GLOBALS"}["pcotpczdcrkf"]} == AgileMultipleSeller::IsProductInMedicalCategory(${${"GLOBALS"}["edbjkvhnjr"]}["id_product"]);
                 if (!${${"GLOBALS"}["otiiwvldsekw"]}) {
                     break;
                 }
             }
             return ${${"GLOBALS"}["otiiwvldsekw"]};
         }
     } else {
         return true;
     }
     return true;
 }
Ejemplo n.º 15
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);
    }
Ejemplo n.º 16
0
    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');
    }
Ejemplo n.º 17
0
 public function processData()
 {
     if (Module::isInstalled('agilemultipleshop') && Shop::$id_shop_owner > 0) {
         if (!Validate::isLoadedObject($this->seller)) {
             $this->errors[] = Tools::displayError('Seller does not exist');
         } elseif (!$this->seller->active) {
             self::$smarty->assign('seller', $this->seller);
         } else {
             $rewrited_url = self::$link->getAgileSellerLink((int) $this->seller->id, $this->getSellerLinkRwrite());
             $this->seller_info->description = _PS_VERSION_ > '1.5' ? Tools::nl2br($this->seller_info->description) : nl2br2($this->seller_info->description);
             // Setting language and language level
             $language_level = explode(',', $this->seller_info->language_level);
             $language = explode(',', $this->seller_info->language);
             $language_array = array();
             for ($x = 0; $x < count($language); $x++) {
                 $language_array[] = $language[$x] . ' - ' . $language_level[$x];
             }
             $this->seller_info->language = $language_array;
             self::$smarty->assign('seller', $this->seller);
             self::$smarty->assign('seller_info', $this->seller_info);
             $imgPath = _PS_ROOT_DIR_ . DS . 'img' . DS . 'as' . DS . $this->seller_info->id_sellerinfo;
             $licenseImg = _PS_ROOT_DIR_ . DS . 'img' . DS . 'as' . DS . $this->seller_info->id_sellerinfo . '_license';
             $images = scandir($imgPath);
             unset($images[0]);
             unset($images[1]);
             $images = array_values($images);
             @($licenseDir = scandir($licenseImg));
             $licenseExist = count($licenseDir) > 2 ? 1 : 0;
             $this->seller_info->seller_images = $images;
             $sellermodule = new AgileMultipleSeller();
             $conf = Configuration::getMultiple($sellermodule->getCustomFields());
             $custom_labels = $sellermodule->getCustomLabels();
             self::$smarty->assign('conf', $conf);
             self::$smarty->assign('custom_labels', $custom_labels);
             $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', ">=");
             $HOOK_SELLER_RATINGS = '';
             if (Module::isInstalled('agilesellerratings')) {
                 require_once _PS_ROOT_DIR_ . "/modules/agilesellerratings/agilesellerratings.php";
                 $rmodule = new AgileSellerRatings();
                 $HOOK_SELLER_RATINGS = $rmodule->getAverageRating($this->id_seller, AgileSellerRatings::RATING_TYPE_SELLER);
             }
             /*foreach($seller_products as $k => $v) {
             			$country = $v['country'];
             			$flagId = Country::getIdByName(1, $country);
             			$seller_products[$k]['img_exist']	= file_exists(_PS_ROOT_DIR_ . DS . 'flag' . DS . 'mini'. DS . $flagId . '.jpg')? 1 : 0;
             			$seller_products[$k]['img_name']	= $flagId . '.jpg';
             		}*/
             foreach ($seller_products as $key => $value) {
                 $seller_id = $value['id_seller'];
                 $flagIds = self::getFlagsId($seller_id);
                 foreach ($flagIds as $k => $flgId) {
                     $seller_products[$key]['img_exist'][$k] = file_exists(_PS_ROOT_DIR_ . DS . 'flag' . DS . 'mini' . DS . $flgId . '.jpg') ? 1 : 0;
                     $seller_products[$key]['img_name'][$k] = $flgId . '.jpg';
                 }
             }
             // die('<pre>' . print_r($seller_products, true));
             self::$smarty->assign(array('products' => (isset($seller_products) and $seller_products) ? $seller_products : NULL, 'license_exist' => $licenseExist, 'id_seller' => (int) $this->seller->id, 'path' => $this->seller_info->company, 'agilesellerproducts_tpl' => _PS_ROOT_DIR_ . "/modules/agilesellerproducts/", 'agilemultipleshop_tpl' => _PS_ROOT_DIR_ . "/modules/agilemultipleshop/", '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'), 'HOOK_SELLER_RATINGS' => $HOOK_SELLER_RATINGS, 'page_name' => 'agileseller'));
             $ver = (int) str_replace(".", "", _PS_VERSION_);
             if ($ver <= 1430) {
             } else {
                 if ($ver <= 1451) {
                     if (isset(self::$cookie->id_customer)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer));
                     } elseif (isset(self::$cookie->id_guest)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest));
                     }
                 } else {
                     if (isset(self::$cookie->id_compare)) {
                         self::$smarty->assign('compareProducts', CompareProduct::getCompareProducts((int) self::$cookie->id_compare));
                     }
                 }
             }
         }
         self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
     }
 }
Ejemplo n.º 18
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);
 }
Ejemplo n.º 19
0
    }
} else {
    $errors .= $paypal->getL('verified');
}
if (!empty($errors) and isset($_POST['custom'])) {
    $_SESSION['agile_paypal_validating_order'] = 1;
    if ($_POST['payment_status'] == 'Pending') {
        $paypal->validateOrder(intval($_POST['custom']), _PS_OS_PAYPAL_, floatval($_POST['mc_gross']), $paypal->displayName, $paypal->getL('transaction') . $_POST['txn_id'] . '<br />' . $errors, array(), NULL, false, $customer->secure_key);
    } else {
        $paypal->validateOrder(intval($_POST['custom']), _PS_OS_ERROR_, 0, $paypal->displayName, $errors . '<br />', array(), NULL, false, $customer->secure_key);
    }
    $_SESSION['agile_paypal_validating_order'] = 0;
}
if (intval($paypal->currentOrder) > 0) {
    $apt = new AgilePaypalTxn();
    $apt->id_cart = intval($_POST['custom']);
    $apt->id_order = $paypal->currentOrder;
    $apt->paypal_txn = $_POST['txn_id'];
    $apt->subscr_id = isset($_POST['subscr_id']) ? $_POST['subscr_id'] : '';
    $apt->remark = 'Payment status:' . $_POST['payment_status'];
    $apt->add();
}
if (intval($paypal->currentOrder) > 0 and Module::isInstalled('agilesellercommission')) {
    include_once dirname(__FILE__) . '/../../modules/agilesellercommission/agilesellercommission.php';
    include_once dirname(__FILE__) . '/../../modules/agilesellercommission/SellerCommission.php';
    SellerCommission::updateRecordType($paypal->currentOrder, intval(Tools::getValue('invoice')), $_POST['txn_id']);
}
if ($customer_isnew == 1 and Module::isInstalled('agilemultipleseller') and intval(Configuration::get('AGILE_MS_CUSTOMER_SELLER')) == 1 and intval(Configuration::get('AGILE_MS_AUTO_SIGNUP')) == 1) {
    include_once dirname(__FILE__) . '/../../modules/agilemultipleseller/agilemultipleseller.php';
    AgileMultipleSeller::createSellerAccount(new Customer($customer->id));
}
 public function agilepaypal_redirect()
 {
     global $cookie, $cart, $smarty, $defaultCountry;
     $error_msg = '';
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         $original_id_cart = AgileMultipleSeller::backup_cart_for_subcart_payment();
     }
     $paypal = new AgilePaypal();
     $cart = new Cart(intval($cookie->id_cart));
     $expresscheckoutkey = md5(_PS_VERSION_ . $cookie->id_cart);
     $address_override = 0;
     $islogged = Context::getContext()->customer->isLogged();
     if ($islogged) {
         $customer = new Customer(intval($cart->id_customer));
         $addresses = $customer->getAddresses($cookie->id_lang);
         $id_address = 0;
         if (!empty($addresses)) {
             foreach ($addresses as $addr) {
                 if (intval($cart->id_address_delivery) == intval($addr['id_address'])) {
                     $id_address = intval($addr['id_address']);
                     break;
                 }
             }
             if ($id_address > 0) {
                 $address = new Address($id_address);
             } else {
                 $address = new Address($addresses[0]['id_address']);
             }
         }
     }
     if (!isset($address) or !$address->id_country) {
         $address = new Address();
         $address->id_country = intval(Tools::getValue('sl_expresscheckout_id_country'));
     }
     if (!isset($address) or !$address->id_country) {
         $address = new Address();
         $address->id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT');
     }
     $country = new Country(intval($address->id_country));
     $zone = new Zone(intval($country->id_zone));
     $doSubmit = ($country->active == 1 and $zone->active == 1 or $cart->isVirtualCart());
     $state = NULL;
     if ($address->id_state) {
         $state = new State(intval($address->id_state));
     }
     if ($islogged) {
         $customer = new Customer(intval($cart->id_customer));
     } else {
         $customer = new Customer();
         $customer->secure_key = md5(uniqid(rand(), true));
     }
     $business = $paypal->getSellerPaypalEmailAddress();
     $header = Configuration::get('AGILE_PAYPAL_HEADER');
     $currency_order = new Currency(intval($cart->id_currency));
     $currency_module = new Currency((int) Configuration::get('AGILE_PAYPAL_CURRENCY'));
     if (!Validate::isEmail($business)) {
         $error_msg .= $paypal->getL('Paypal error: (invalid or undefined business account email)');
     }
     if (!Validate::isLoadedObject($currency_module)) {
         $error_msg .= $paypal->getL('Currency Restriction: (Invalid currency restriction setting for this module)');
     }
     $customercurrency = $cookie->id_currency;
     $defaultCountryAgile = $defaultCountry;
     $defaultCountry = $country;
     $the_rate = $currency_order->conversion_rate / $currency_module->conversion_rate;
     $cartproducts = $cart->getProducts();
     $prod_total = $cart->getOrderTotal(true, Cart::ONLY_PRODUCTS);
     $discount = abs(floatval($cart->getOrderTotal(true, Cart::ONLY_DISCOUNTS)));
     $all_total = $cart->getOrderTotal(true, Cart::BOTH);
     $business2 = $paypal->getSellerPaypalMicroEmailAddress();
     $micro_amount = floatval(Configuration::get('AGILE_PAYPAL_MICRO_AMOUNT'));
     if (isset($business2) and strlen(trim($business2)) > 0 and isset($micro_amount) and floatval($micro_amount) > 0 and floatval($all_total) <= $micro_amount) {
         $business = $business2;
     }
     if (version_compare(_PS_VERSION_, '1.5', '>=')) {
         $shipping = Tools::ps_round(floatval($cart->getOrderTotal(true, Cart::ONLY_SHIPPING)), 2);
     } else {
         $shipping = Tools::ps_round(floatval($cart->getOrderShippingCost()) + floatval($cart->getOrderTotal(true, Cart::ONLY_WRAPPING)), 2);
     }
     if (!empty($error_msg)) {
         $doSubmit = 0;
     }
     $smarty->assign(array('redirect_text' => $paypal->getL($doSubmit == 1 ? 'Please wait, redirecting to Paypal... Thanks.' : 'Sorry, we do not ship to your country.'), 'cancel_text' => $paypal->getL('Cancel'), 'cart_text' => $paypal->getL('My cart'), 'return_text' => $paypal->getL('Return to shop'), 'paypal_url' => $paypal->getPaypalUrl(), 'address' => $address, 'country' => $country, 'state' => $state, 'doSubmit' => $doSubmit, 'baseUrl' => __PS_BASE_URI__, 'address_override' => $address_override, 'amount' => floatval($cart->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING)), 'customer' => $customer, 'all_total' => $all_total, 'shipping' => $shipping, 'discount' => $discount, 'show_discount' => $prod_total > $discount ? 1 : 0, 'business' => $business, 'currency_module' => $currency_module, 'cart_id' => intval($cart->id), 'products' => $cartproducts, 'paypal_id' => intval($paypal->id), 'invoice' => intval(Configuration::get('AGILE_MS_PAYMENT_MODE')), 'header' => $header, 'expresscheckoutkey' => $expresscheckoutkey, 'id_subcart' => intval(Tools::getValue('id_subcart')), 'PS_ALLOW_MOBILE_DEVICE' => 0, 'agile_url' => (_PS_VERSION_ > '1.4' ? Tools::getShopDomainSsl(true, true) : Tools::getHttpHost(true, true)) . __PS_BASE_URI__, 'agilepaypal_return_url' => $this->get_return_url(), 'error_msg' => $error_msg, 'the_rate' => $the_rate));
     $cookie->id_currency = $customercurrency;
     $defaultCountry = $defaultCountryAgile;
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         AgileMultipleSeller::restore_cart_for_subcart_payment($original_id_cart);
     }
 }
Ejemplo n.º 21
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"]});
 }
 public function initContentForAssociations()
 {
     $vwvooilwtfmt = "sql";
     ${"GLOBALS"}["cgrvkkbvma"] = "root";
     ${"GLOBALS"}["lsrhvhqjf"] = "selected_cat";
     ${"GLOBALS"}["lknocboq"] = "helper";
     ${${"GLOBALS"}["cgrvkkbvma"]} = Category::getRootCategory();
     $szksmz = "selected_cat";
     $ifaquczty = "category_tree";
     ${"GLOBALS"}["ptiwphji"] = "category_tree";
     ${"GLOBALS"}["veloultyacp"] = "default_category";
     ${$vwvooilwtfmt} = "SELECT id_category_default FROM " . _DB_PREFIX_ . "product WHERE id_product=" . intval($this->object->id);
     ${${"GLOBALS"}["njpsstddwx"]} = intval(Db::getInstance()->getValue(${${"GLOBALS"}["vvskebgpewm"]}));
     ${"GLOBALS"}["nqufiynxn"] = "category_tree";
     if (!$this->object->id) {
         ${${"GLOBALS"}["rnirxjg"]} = Category::getCategoryInformations(Tools::getValue("categoryBox", array(${${"GLOBALS"}["veloultyacp"]})), $this->id_language);
     } else {
         if (Tools::isSubmit("categoryBox")) {
             ${${"GLOBALS"}["rnirxjg"]} = Category::getCategoryInformations(Tools::getValue("categoryBox", array(${${"GLOBALS"}["njpsstddwx"]})), $this->id_language);
         } else {
             ${${"GLOBALS"}["rnirxjg"]} = Product::getProductCategoriesFull($this->object->id, $this->id_language);
         }
     }
     ${"GLOBALS"}["mwlyyqxnvr"] = "selected_cat";
     if (!array_key_exists(${${"GLOBALS"}["njpsstddwx"]}, ${$szksmz})) {
         ${"GLOBALS"}["veixrgsr"] = "default_category";
         ${"GLOBALS"}["rjxpfcwol"] = "sql";
         $epyobpqsn = "selected_cat";
         ${${"GLOBALS"}["rjxpfcwol"]} = "SELECT id_category, name, link_rewrite, id_lang FROM " . _DB_PREFIX_ . "category_lang WHERE id_category=" . ${${"GLOBALS"}["veixrgsr"]} . " AND id_lang=" . intval($this->id_language);
         $tvjsbnwmt = "default_category";
         ${$epyobpqsn}[${$tvjsbnwmt}] = Db::getInstance()->getRow(${${"GLOBALS"}["vvskebgpewm"]});
     }
     self::$smarty->assign("feature_shop_active", Shop::isFeatureActive());
     ${${"GLOBALS"}["vppwhfouit"]} = new HelperForm();
     if ($this->object && $this->object->id) {
         $helper->id = $this->object->id;
     } else {
         $helper->id = null;
     }
     $helper->table = "product";
     $helper->identifier = "id_product";
     self::$smarty->assign("displayAssoShop", $helper->renderAssoShop());
     ${${"GLOBALS"}["doeaqcaombq"]} = Product::getAccessoriesLight($this->id_language, $this->object->id);
     if (${${"GLOBALS"}["yfkrfqnu"]} = Tools::getValue("inputAccessories")) {
         ${${"GLOBALS"}["qmhlnpccscr"]} = explode("-", Tools::getValue("inputAccessories"));
         foreach (${${"GLOBALS"}["qmhlnpccscr"]} as ${${"GLOBALS"}["vertwbyora"]}) {
             $uypybcj = "accessory";
             ${"GLOBALS"}["wuwogouethxi"] = "accessory_id";
             ${"GLOBALS"}["mkrmryb"] = "accessory";
             $rukqokdbuw = "accessories";
             if (!$this->haveThisAccessory(${${"GLOBALS"}["wuwogouethxi"]}, ${${"GLOBALS"}["doeaqcaombq"]}) && (${${"GLOBALS"}["mkrmryb"]} = Product::getAccessoryById(${${"GLOBALS"}["vertwbyora"]}))) {
                 ${$rukqokdbuw}[] = ${$uypybcj};
             }
         }
     }
     self::$smarty->assign("accessories", ${${"GLOBALS"}["doeaqcaombq"]});
     ${${"GLOBALS"}["vbwuxas"]} = array("id_category" => $root->id, "name" => $root->name);
     ${${"GLOBALS"}["lknocboq"]} = new Helper();
     ${${"GLOBALS"}["bfswydsx"]} = AgileMultipleSeller::getSpecialCatrgoryIdsArray();
     ${${"GLOBALS"}["nqufiynxn"]} = $helper->renderCategoryTree(${${"GLOBALS"}["vbwuxas"]}, ${${"GLOBALS"}["mwlyyqxnvr"]}, "categoryBox", false, true, ${${"GLOBALS"}["bfswydsx"]});
     ${${"GLOBALS"}["ptiwphji"]} = ${${"GLOBALS"}["dwiitcql"]} . "\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\$(document).ready(function(){\n\t\t\t\tbuildTreeView();\n\t\t\t});</script>\n\t\t\t";
     self::$smarty->assign(array("default_category" => ${${"GLOBALS"}["njpsstddwx"]}, "selected_cat_ids" => implode(",", array_keys(${${"GLOBALS"}["lsrhvhqjf"]})), "selected_cat" => ${${"GLOBALS"}["rnirxjg"]}, "id_category_default" => $this->object->getDefaultCategory(), "category_tree" => ${$ifaquczty}, "product" => $this->object, "agile_ms_edit_category" => Configuration::get("AGILE_MS_EDIT_CATEGORY"), "link" => $this->context->link, "id_first_available_category" => AgileHelper::GetFirstAvailableCategory(), "ajx_category_url" => AgileMultipleSeller::get_agile_ajax_categories_url()));
 }
Ejemplo n.º 23
0
 public function add($autodate = true, $nullValues = false)
 {
     $res = parent::add($autodate, $nullValues);
     if (Module::isInstalled('agilemultipleseller') and $res) {
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         AgileMultipleSeller::sendNewProductEmail($this->id);
     }
     if (Module::isInstalled('agilesellerlistoptions') and $res) {
         require_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
         $aslo = new AgileSellerListOptions();
         $aslo->processProductExtenstions(array('product' => $this));
     }
     return $res;
 }
Ejemplo n.º 24
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"]});
     }
 }
Ejemplo n.º 25
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"]});
 }
 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);
     }
 }
Ejemplo n.º 27
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"]});
 }
Ejemplo n.º 28
0
 public function displayForm()
 {
     $cufhncfg = "conf";
     ${"GLOBALS"}["ljvxdvr"] = "conf_keys";
     $bxsfaifp = "conf";
     global $cookie;
     ${${"GLOBALS"}["ljvxdvr"]} = array("AGILE_MS_SELLER_APPROVAL", "AGILE_MS_custom_SELLER", "AGILE_MS_EDIT_CATEGORY", "AGILE_MS_PAYMENT_MODE", "AGILE_MS_SELLER_TAB", "AGILE_MS_CART_MODE", "AGILE_MS_PRODUCT_APPROVAL", "AGILE_MS_SELLER_TERMS", "AGILE_MS_CUSTOMER_SELLER", "AGILE_MS_SELLER_PANEL_WITHRIGHT", "AGILE_MS_SELLER_PANEL_WITHLEFT", "AGILE_MS_ALLOW_REGISTER_ATHOME", "AGILE_MS_SELLER_BACK_OFFICE", "AGILE_MS_SELLER_INFO_THEME");
     ${${"GLOBALS"}["hshqjfegdmp"]} = array_merge(${${"GLOBALS"}["hshqjfegdmp"]}, AgileMultipleSeller::getCustomFields());
     ${$cufhncfg} = Configuration::getMultiple(${${"GLOBALS"}["hshqjfegdmp"]});
     $vkpenkovav = "permissiontabid";
     ${${"GLOBALS"}["kqjeegayb"]} = Tools::getValue("seller_tab", array_key_exists("AGILE_MS_SELLER_TAB", ${${"GLOBALS"}["umntfbicqtr"]}) ? ${$bxsfaifp}["AGILE_MS_SELLER_TAB"] : "");
     ${${"GLOBALS"}["diduefcuz"]} = Tab::getIdFromClassName("AdminAccess");
     ${${"GLOBALS"}["nkjjmcl"]} = Tools::getAdminToken("AdminAccess" . intval(${$vkpenkovav}) . intval($cookie->id_employee));
     ${${"GLOBALS"}["jybeht"]} = new Profile(intval(Configuration::get("AGILE_MS_PROFILE_ID")), $cookie->id_lang);
     if (version_compare(_PS_VERSION_, "1.5.0", "<")) {
         $this->_html .= "<div style=\"color:red;font-size:18px;\"><br>\n\t\t\t\t\t" . $this->l('This module does not work under PrestaShop 1.4x.') . "<br>\n\t\t\t\t\t" . $this->l('You are using the wrong version of the module.') . "<br>\n\t\t\t\t\t" . $this->l('Please contact support@addons-modules.com for more details.') . "<br><br>\n\t\t\t\t\t\n\t\t\t\t\t</div>";
     } else {
         ${"GLOBALS"}["tebdjdn"] = "array2_field";
         ${"GLOBALS"}["wiexhccp"] = "i";
         $this->context->controller->addCSS($this->_path . "css/agileglobal.css", "all");
         $this->context->controller->addCSS($this->_path . "css/agilemultipleseller.css", "all");
         ${${"GLOBALS"}["obbrlmm"]} = $this->getCustomLabels();
         $mkfyeue = "array4_fieldvalue";
         ${"GLOBALS"}["kauhnbewx"] = "i";
         ${${"GLOBALS"}["mnkreui"]} = array();
         ${"GLOBALS"}["omwbsquklu"] = "seller_tab";
         $imcufh = "i";
         ${${"GLOBALS"}["tebdjdn"]} = array();
         ${"GLOBALS"}["wfexxaddiy"] = "i";
         for (${${"GLOBALS"}["kauhnbewx"]} = 1; ${${"GLOBALS"}["hoqimumve"]} <= 10; ${${"GLOBALS"}["wiexhccp"]}++) {
             $yrqpesfsncc = "array2_fieldvalue";
             ${"GLOBALS"}["krxwzc"] = "key";
             $pfvgyzqkglr = "text";
             $gyuyrrvrjya = "conf";
             ${"GLOBALS"}["oefebkfx"] = "field_name";
             ${${"GLOBALS"}["krxwzc"]} = sprintf("AGILE_MS_SELLER_TEXT%s", ${${"GLOBALS"}["hoqimumve"]});
             ${"GLOBALS"}["incgmvnvb"] = "key";
             $jqvqknqhisg = "key";
             ${"GLOBALS"}["fwtfspbm"] = "conf";
             ${${"GLOBALS"}["jjjecy"]} = sprintf("ams_custom_text%s", ${${"GLOBALS"}["hoqimumve"]});
             ${"GLOBALS"}["uqnmwbmhhdw"] = "field_name";
             ${"GLOBALS"}["khcrmn"] = "text";
             ${$pfvgyzqkglr} = array_key_exists(${${"GLOBALS"}["uqnmwbmhhdw"]}, $_POST) ? $_POST[${${"GLOBALS"}["jjjecy"]}] : (array_key_exists(${${"GLOBALS"}["incgmvnvb"]}, ${$gyuyrrvrjya}) ? ${${"GLOBALS"}["fwtfspbm"]}[${$jqvqknqhisg}] : "");
             ${$yrqpesfsncc}[${${"GLOBALS"}["jjjecy"]}] = ${${"GLOBALS"}["khcrmn"]};
             array_push(${${"GLOBALS"}["xteddyw"]}, array("id" => ${${"GLOBALS"}["oefebkfx"]}, "name" => ${${"GLOBALS"}["jjjecy"]}, "label" => ${${"GLOBALS"}["obbrlmm"]}[${${"GLOBALS"}["jjjecy"]}]));
         }
         ${"GLOBALS"}["ubqssnk"] = "lang";
         ${"GLOBALS"}["rmdjxwl"] = "profile";
         ${${"GLOBALS"}["brfuori"]} = array();
         $wgqdrawwvsd = "array2_field";
         ${${"GLOBALS"}["ixehsvr"]} = array();
         $ctgbmqvvw = "array5_field";
         for (${${"GLOBALS"}["hoqimumve"]} = 1; ${${"GLOBALS"}["hoqimumve"]} <= 2; ${${"GLOBALS"}["hoqimumve"]}++) {
             $jbftdltdb = "conf";
             ${"GLOBALS"}["hrjqpvc"] = "i";
             ${"GLOBALS"}["fddlvewegc"] = "field_name";
             ${"GLOBALS"}["hprsmop"] = "field_name";
             $befumlspkc = "key";
             ${"GLOBALS"}["dejuonhbmue"] = "html";
             ${${"GLOBALS"}["olbxneb"]} = sprintf("AGILE_MS_SELLER_HTML%s", ${${"GLOBALS"}["hrjqpvc"]});
             ${"GLOBALS"}["yqqoyjifydk"] = "field_name";
             $vevbokofmkr = "field_name";
             ${${"GLOBALS"}["jjjecy"]} = sprintf("ams_custom_html%s", ${${"GLOBALS"}["hoqimumve"]});
             $xjdpdika = "field_name";
             ${${"GLOBALS"}["pmakfob"]} = array_key_exists(${${"GLOBALS"}["hprsmop"]}, $_POST) ? $_POST[${${"GLOBALS"}["yqqoyjifydk"]}] : (array_key_exists(${${"GLOBALS"}["olbxneb"]}, ${$jbftdltdb}) ? ${${"GLOBALS"}["umntfbicqtr"]}[${$befumlspkc}] : "");
             ${${"GLOBALS"}["brfuori"]}[${$xjdpdika}] = ${${"GLOBALS"}["dejuonhbmue"]};
             array_push(${${"GLOBALS"}["ixehsvr"]}, array("id" => ${${"GLOBALS"}["jjjecy"]}, "name" => ${$vevbokofmkr}, "label" => ${${"GLOBALS"}["obbrlmm"]}[${${"GLOBALS"}["fddlvewegc"]}]));
         }
         ${$mkfyeue} = array();
         $kptflxfro = "array2_fieldvalue";
         $rtuoxbd = "i";
         ${${"GLOBALS"}["zmhmzerls"]} = array();
         for (${${"GLOBALS"}["hoqimumve"]} = 1; ${$imcufh} <= 10; ${${"GLOBALS"}["hoqimumve"]}++) {
             ${"GLOBALS"}["finegrrv"] = "html";
             ${"GLOBALS"}["saxyiemeq"] = "array4_fieldvalue";
             ${"GLOBALS"}["zeulmkl"] = "key";
             $jfyjtpglgom = "field_name";
             ${"GLOBALS"}["tmsgrnys"] = "i";
             ${"GLOBALS"}["xbqapewp"] = "i";
             ${${"GLOBALS"}["zeulmkl"]} = sprintf("AGILE_MS_SELLER_NUMBER%s", ${${"GLOBALS"}["xbqapewp"]});
             ${"GLOBALS"}["zdarvygleq"] = "key";
             $lgfyjsnoujp = "conf";
             ${"GLOBALS"}["yskkllcyevq"] = "field_name";
             ${"GLOBALS"}["xeiqmovs"] = "array4_field";
             ${${"GLOBALS"}["jjjecy"]} = sprintf("ams_custom_number%s", ${${"GLOBALS"}["tmsgrnys"]});
             ${${"GLOBALS"}["finegrrv"]} = array_key_exists(${${"GLOBALS"}["yskkllcyevq"]}, $_POST) ? $_POST[${$jfyjtpglgom}] : (array_key_exists(${${"GLOBALS"}["olbxneb"]}, ${${"GLOBALS"}["umntfbicqtr"]}) ? ${$lgfyjsnoujp}[${${"GLOBALS"}["zdarvygleq"]}] : "");
             ${${"GLOBALS"}["saxyiemeq"]}[${${"GLOBALS"}["jjjecy"]}] = ${${"GLOBALS"}["pmakfob"]};
             array_push(${${"GLOBALS"}["xeiqmovs"]}, array("id" => ${${"GLOBALS"}["jjjecy"]}, "name" => ${${"GLOBALS"}["jjjecy"]}, "label" => ${${"GLOBALS"}["obbrlmm"]}[${${"GLOBALS"}["jjjecy"]}]));
         }
         ${${"GLOBALS"}["ftilrxsmpbw"]} = array();
         ${$ctgbmqvvw} = array();
         for (${${"GLOBALS"}["wfexxaddiy"]} = 1; ${${"GLOBALS"}["hoqimumve"]} <= 5; ${$rtuoxbd}++) {
             $ulwbpd = "conf";
             $ygbqccwer = "field_name";
             ${"GLOBALS"}["tknsbexir"] = "field_name";
             ${"GLOBALS"}["tijnqbcupeuj"] = "custom_lables";
             ${"GLOBALS"}["xlkuwci"] = "conf";
             ${"GLOBALS"}["nxvgbmw"] = "html";
             ${${"GLOBALS"}["olbxneb"]} = sprintf("AGILE_MS_SELLER_DATE%s", ${${"GLOBALS"}["hoqimumve"]});
             $goomdn = "array5_field";
             ${${"GLOBALS"}["tknsbexir"]} = sprintf("ams_custom_date%s", ${${"GLOBALS"}["hoqimumve"]});
             ${${"GLOBALS"}["pmakfob"]} = array_key_exists(${${"GLOBALS"}["jjjecy"]}, $_POST) ? $_POST[${$ygbqccwer}] : (array_key_exists(${${"GLOBALS"}["olbxneb"]}, ${${"GLOBALS"}["xlkuwci"]}) ? ${$ulwbpd}[${${"GLOBALS"}["olbxneb"]}] : "");
             $bkwjsyetxiol = "array5_fieldvalue";
             ${$bkwjsyetxiol}[${${"GLOBALS"}["jjjecy"]}] = ${${"GLOBALS"}["nxvgbmw"]};
             array_push(${$goomdn}, array("id" => ${${"GLOBALS"}["jjjecy"]}, "name" => ${${"GLOBALS"}["jjjecy"]}, "label" => ${${"GLOBALS"}["tijnqbcupeuj"]}[${${"GLOBALS"}["jjjecy"]}]));
         }
         ${${"GLOBALS"}["hxfvuydgc"]} = array("form" => array("legend" => array("title" => $this->l('Settings'), "image" => $this->_path . "logo.gif"), "input" => array(array("type" => "text", "label" => $this->l('Seller Terms & Conditions'), "class" => "width10", "name" => "seller_terms", "desc" => $this->l('Please enter the CMS page ID for Seller Terms & Conditions. Enter "0" if there is no Seller Terms & Conditions.')), array("type" => "agile_radio", "label" => $this->l('Payment Collection Mode'), "name" => "payment_mode", "header" => array($this->l('This setting will affect the seller account history records and balances calculation.'), $this->l('The account history and account balance will updated at the time the order status is changed to "Payment Accepted"'), array("class" => "red", "text" => $this->l('If your payment methods do not match your settings, the account history records and account balances will be incorrect.'))), "values" => array(array("id" => "payment_mode_store", "value" => 3, "label" => $this->l('Store collects payments'), "p" => $this->l('You can use any payment modules available in your store, but you will need to pay sellers\' account balances separately.')), array("id" => "payment_mode_seller", "value" => 1, "label" => $this->l('Seller collects payments'), "p" => array($this->l('Only customized (Agile Multiple Seller integrated) payment modules are supported for this payment collection mode'), $this->l('Seller will need to pay the store for any accounts owed (commissions) separately.'))), array("id" => "payment_mode_both", "value" => 2, "label" => $this->l('Both Store and Seller collect payment '), "p" => array($this->l('Only customized (Agile Multiple Seller integrated) payment modules with split payment function are supported.<br>Payments among customers, sellers, and store are distributed automatically. No additional payment is required.'), "<a href=\"http://addons-modules.com/en/content/28-how-to-choose-payment\" style=\"color:blue;text-decoration:underline;\" target=\"_new\">" . $this->l('Click here') . "</a>&nbsp;" . $this->l('to find more information on how to set the "Payment Collection Mode" and choose payment methods correctly.'))))), array("type" => "htmlhr", "name" => "seller_term_section", "values" => array()), array("type" => "radio", "label" => $this->l('Shopping Cart Mode'), "name" => "cart_mode", "values" => array(array("id" => "cart_mode_multipleseller", "value" => 0, "label" => $this->l('Products from multiple seller')), array("id" => "cart_mode_singleseller", "value" => 1, "label" => $this->l('Product from single seller'))), "desc" => "<a href=\"http://addons-modules.com/en/content/28-how-to-choose-payment\" style=\"color:blue;text-decoration:underline;\" target=\"_new\">" . $this->l('Click here') . "</a>&nbsp;" . $this->l(' to see section "D. Payemnt collection mode, Shipping Cart mode" for more details.')), array("type" => "htmlhr", "name" => "shoppingcart_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Listing Approval Required'), "name" => "product", "values" => array("query" => array(array("id" => "approval", "val" => 1, "name" => $this->l('Do you want approve seller products before they are listed?'))), "id" => "id", "name" => "name")), array("type" => "htmlhr", "name" => "approval_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Allow customer to be a seller'), "name" => "customer", "values" => array("query" => array(array("id" => "seller", "val" => 1, "name" => $this->l('Allow customers to sign up for a sellers account and list products.'))), "id" => "id", "name" => "name")), array("type" => "checkbox", "label" => $this->l('Account Approval Required'), "name" => "seller", "values" => array("query" => array(array("id" => "approval", "val" => 1, "name" => $this->l('Sellers registering from the front office are required to be approved/activated by Admin.'))), "id" => "id", "name" => "name")), array("type" => "htmlhr", "name" => "customer_seller_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Seller back office access'), "name" => "seller", "values" => array("query" => array(array("id" => "back_office", "val" => 1, "name" => $this->l('If you want to allow seller to access back office'))), "id" => "id", "name" => "name")), array("type" => "htmlhr", "name" => "seller_backoffice_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Seller Products At Store Home'), "name" => "allow_register", "values" => array("query" => array(array("id" => "athome", "val" => 1, "name" => $this->l('If you want to allow seller to register product at store Home category'))), "id" => "id", "name" => "name")), array("type" => "htmlhr", "name" => "register_athome_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Edit product category'), "name" => "edit", "values" => array("query" => array(array("id" => "category", "val" => 1, "name" => $this->l('Allow the seller the following permissions for product categories:  add/edit/enable/disable.'))), "id" => "id", "name" => "name")), array("type" => "htmlhr", "name" => "edit_category_section", "values" => array()), array("type" => "checkbox", "label" => $this->l('Seller Info Tab'), "name" => "seller", "values" => array("query" => array(array("id" => "tab", "val" => 1, "name" => $this->l('Checking this box adds a new tab on the Product Detail page in the Front Office (store), for seller added products. This new tab displays the seller\'s information (i.e. address and phone number), as well as the seller\'s location in a Google Maps window if they so choose.'))), "id" => "id", "name" => "name")), array("type" => "radio", "label" => $this->l('Seller Info Theme Style'), "name" => "seller_info_theme", "form_group_class" => "seller_info_theme " + (${${"GLOBALS"}["omwbsquklu"]} ? "" : "hidden"), "values" => array(array("id" => "vertical", "value" => 1, "label" => $this->l('Vertical'), "p" => "This is the tab style of default theme pf PrestaShop 1.6"), array("id" => "horizonal", "value" => 2, "label" => $this->l('Horizontal'), "p" => "This is the tab style of default theme of PrestaShop 1.5"))), array("type" => "htmlhr", "name" => "seller_info_section", "values" => array()), array("type" => "checkboxgroup", "label" => $this->l('Custom Fields'), "name" => "customized_fields", "header" => $this->l('You can choose to use following custom fileds for additional informaiton of seller. Tips: You can use PrestaShop translation funciton to change the display name of each field. '), "values" => array(array("section_name" => "customize_text", "items" => ${$wgqdrawwvsd}), array("section_name" => "customize_html", "items" => ${${"GLOBALS"}["ixehsvr"]}), array("section_name" => "customize_number", "items" => ${${"GLOBALS"}["zmhmzerls"]}), array("section_name" => "customize_date", "items" => ${${"GLOBALS"}["vxywymmyyyy"]}))), array("type" => "htmlhr", "name" => "customized_field_section", "values" => array()), array("type" => "hidden", "name" => "profile_id"), array("type" => "text", "label" => $this->l('Linked Profile'), "readonly" => 1, "name" => "profilename", "desc" => $this->l('By installing this module, a new employee profile called "agilemultipleseller" was created and is now linked to this module. You can view this new profile by going to the "Administration" -> "Employees" tab.'))), "submit" => array("title" => $this->l('Save'))));
         ${${"GLOBALS"}["pborwzm"]} = new HelperForm();
         $helper->show_toolbar = false;
         $helper->table = $this->name;
         ${${"GLOBALS"}["ubqssnk"]} = new Language((int) Configuration::get("PS_LANG_DEFAULT"));
         $helper->default_form_language = $lang->id;
         $helper->module = $this;
         $helper->allow_employee_form_lang = Configuration::get("PS_BO_ALLOW_EMPLOYEE_FORM_LANG") ? Configuration::get("PS_BO_ALLOW_EMPLOYEE_FORM_LANG") : 0;
         $helper->identifier = $this->identifier;
         $helper->submit_action = "submitSetting";
         $helper->currentIndex = $this->context->link->getAdminLink("AdminModules", false) . "&configure=" . $this->name . "&tab_module=" . $this->tab . "&module_name=" . $this->name;
         $helper->token = Tools::getAdminTokenLite("AdminModules");
         $helper->tpl_vars = array("fields_value" => array_merge($this->getConfigFieldsValues(${${"GLOBALS"}["rmdjxwl"]}, ${${"GLOBALS"}["umntfbicqtr"]}), ${$kptflxfro}, ${${"GLOBALS"}["brfuori"]}, ${${"GLOBALS"}["xmwyqrjrzn"]}, ${${"GLOBALS"}["ftilrxsmpbw"]}), "languages" => $this->context->controller->getLanguages(), "id_language" => $this->context->language->id);
         $this->_html .= $helper->generateForm(array(${${"GLOBALS"}["hxfvuydgc"]}));
         $this->_html .= " \n\t\t\t<fieldset id=\"instructions\">\n\t\t\t<legend><img src=\"" . $this->_path . "logo.gif\" alt=\"\" title=\"\" />" . $this->l('Maintenance Notes') . "</legend>\n\t\t    <div class=\"alert alert-info\">" . $this->l('1. You can view and/or modify the permissions for the "agilemultipleseller" profile by going to the "Administration" -> "Permissions" tab and selecting "agilemultipleseller" from the list.') . "&nbsp;<a href=\"./index.php?tab=AdminAccess&profile=" . $profile->id . "&token=" . ${${"GLOBALS"}["nkjjmcl"]} . "\" style=\"color:Blue;text-decoration:underline;\">" . $this->l('Or, just click here.') . "</a><br />\n\t    \t        <font color=\"red\">" . $this->l('2.  Please DO NOT DELETE this profile') . "<br /></font>\n\t\t\t\t</div>\n\t\t\t</fieldset>\n\t\t\t";
         $this->context->controller->addJS(array(_PS_ROOT_DIR_ . "/modules/agilemultipleseller/js/agile_admin.js"));
     }
 }