public function processSave() { $jlvgbvqxiei = "country"; ${$jlvgbvqxiei} = new Country((int) $_POST["id_country"]); if (Validate::isLoadedObject(${${"GLOBALS"}["fapdtp"]}) && !$country->contains_states) { $_POST["id_state"] = 0; } if (Tools::isSubmit("submitAddsellerinfo")) { if (!isset($_POST["email"]) or empty($_POST["email"])) { $this->errors[] = Tools::displayError("Front store account email is required."); } if (!isset($_POST["seller_employee_email"]) or empty($_POST["seller_employee_email"])) { $this->errors[] = Tools::displayError("Back office account email is required."); } } if (!empty($this->errors)) { $this->redirect_after = false; return false; } parent::processSave(); }
public function processSave() { parent::processSave(); }
public function processSave() { require_once dirname(__FILE__) . "/AgileSellerPaymentInfo.php"; if (Tools::getValue("id_seller") <= 0) { $this->errors[] = Tools::displayError("Seller is required."); } if (Tools::getValue("id_agile_seller_paymentinfo") <= 0) { if (AgileSellerPaymentInfo::is_seller_payment_info_existed(Tools::getValue("module_name"), Tools::getValue("id_seller"))) { $this->errors[] = Tools::displayError("Seller Payment Info " . Tools::getValue("module_name") . " module already exsited."); } } ${${"GLOBALS"}["oxouihb"]} = array(" ", "\t", "\r\n", "\n", "\r"); if (Tools::getValue("module_name") == "googlecheckout") { $tsookg = "toRemove"; $_POST["info1"] = str_replace(${$tsookg}, "", $_POST["info1"]); if (AgileSellerPaymentInfo::is_seller_payment_account_existed("googlecheckout", Tools::getValue("id_seller"), Tools::getValue("info1"))) { $this->errors[] = Tools::displayError("The google checkout merchant id has been used by another seller."); } } if (Tools::getValue("module_name") == "agilepaypal") { ${"GLOBALS"}["aaifkstfva"] = "toRemove"; $_POST["info1"] = str_replace(${${"GLOBALS"}["aaifkstfva"]}, "", $_POST["info1"]); if (AgileSellerPaymentInfo::is_seller_payment_account_existed("agilepaypal", Tools::getValue("id_seller"), Tools::getValue("info1"))) { $this->errors[] = Tools::displayError("The paypal account email address has been used by another seller."); } if (((int) $_POST["in_use_on"] || !empty($_POST["info1"])) && !Validate::isEmail($_POST["info1"])) { $this->errors[] = Tools::displayError("The paypal account email is invalid."); } } if (!empty($this->errors)) { $this->redirect_after = false; return false; } $_POST["in_use"] = (int) Tools::getValue("in_use_on"); parent::processSave(); }
public function processSave() { $object = parent::processSave(); if ($object) { if (empty($this->errors)) { $save_path = rtrim($this->conf['img_save_path'], '/') . "/"; $groupList = Tools::getValue('groupBox'); $object->cleanCategories(); if (is_array($groupList) and sizeof($groupList) > 0) { $object->addCategories($groupList); } $object->cleanProducts(); if (Tools::getValue('inputAccessories')) { $productArray = explode('-', Tools::getValue('inputAccessories'), -1); $object->addProducts($productArray); } $groupRelated = Tools::getValue('groupRelated'); $object->cleanRelated(); if (is_array($groupRelated) and sizeof($groupRelated) > 0) { $object->addRelated($groupRelated); } $images_position = Tools::getValue('img_pos'); if (is_array($images_position) && count($images_position)) { $object->setImagesPosition($images_position); } if (isset($_FILES['blog_img']) && !empty($_FILES['blog_img']['tmp_name'][0])) { $j = 0; foreach ($_FILES['blog_img']['name'] as $key => $val) { if (empty($val)) { continue; } $id_img = null; try { $file['name'] = $val; $file['type'] = $_FILES['blog_img']['type'][$key]; $file['error'] = $_FILES['blog_img']['error'][$key]; $file['size'] = $_FILES['blog_img']['size'][$key]; $file['tmp_name'] = $_FILES['blog_img']['tmp_name'][$key]; //img name $curr_time = time() + $j; $ext = substr(strrchr($file['name'], '.'), 1); $img_name = $curr_time . '.' . $ext; $dest = _PS_ROOT_DIR_ . '/' . $save_path; $this->checkFile($file, $dest); $id_img = $object->addImage($img_name, 0); $this->uploadFile($file, $dest . $img_name); $object->generateImageThumbs($id_img); } catch (Exception $e) { $this->_errors[] = Tools::displayError($e->getMessage()); if (!is_null($id_img)) { $object->removeImage($id_img); } } $j++; } } BlogShop::generateSitemap(); if (Tools::getValue('blog_img_default')) { $idImg = Tools::getValue('blog_img_default'); $object->setImageDefault($idImg); } elseif ($object->getImages(true) > 0) { $object->setImageDefault(0); } } } return $object; }
public function processSave() { if (Tools::getIsset('addnow_block_cms_footer') || Tools::getIsset('updatenow_block_cms_footer') || Tools::getIsset('submitAddnow_block_cms_footer')) { $this->redirect_after = self::$currentIndex . '&id_now_block_cms_footer_column=' . Tools::getValue('id_now_block_cms_footer_column', $this->object->id_now_block_cms_footer_column) . '&detailsnow_block_cms_footer_column&token=' . $this->token; } return parent::processSave(); }
public function processSave() { $id_produt_purchased = Tools::getValue('id_product_purchased'); $id_produt_discounted = Tools::getValue('id_product_discounted'); if ($id_produt_purchased == $id_produt_discounted) { $this->errors[] = Tools::displayError($this->l('Products purchased and discounted cannot be the same.')); } $obj = $this->loadObject(true); if (($id_produt_purchased != $obj->id_product_purchased || $id_produt_discounted != $obj->id_product_discounted) && LoyaltyDiscountModel::loyaltyDiscountExists($id_produt_purchased, $id_produt_discounted)) { $this->errors[] = Tools::displayError($this->l('There are already a loyalty discount with this current product configuration.')); } return parent::processSave(); }