/** * @see FrontController::postProcess() */ public function postProcess() { parse_str($_POST['optData'], $optData); $id_cart = (int) $optData['cartId']; $cart = new Cart($id_cart); if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { die('Cannot create order for this cart.'); } $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) { die('No customer for this order.'); } $currency = new Currency((int) $cart->id_currency); $paid_amount = $_POST['amount']; $order_amount = $cart->getOrderTotal(true, Cart::BOTH); $apiHash = $_SERVER['HTTP_API_HASH']; $query = http_build_query($_POST); $hash = hash_hmac("sha512", $query, $this->module->secret_key); if ($apiHash == $hash && $paid_amount == $order_amount) { //success $this->module->validateOrder($cart->id, Configuration::get('PS_OS_PAYMENT'), $paid_amount, $this->module->displayName, 'Invoice Code: ' . $_POST['invoiceCode'], array(), (int) $currency->id, false, $customer->secure_key); } else { //failed transaction } }
/** * @see ObjectModel::delete() */ public function delete() { if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute_combination WHERE id_attribute = ' . (int) $this->id); $products = array(); foreach ($result as $row) { $combination = new Combination($row['id_product_attribute']); $newRequest = Db::getInstance()->executeS('SELECT id_product, default_on FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product_attribute = ' . (int) $row['id_product_attribute']); foreach ($newRequest as $value) { if ($value['default_on'] == 1) { $products[] = $value['id_product']; } } $combination->delete(); } foreach ($products as $product) { $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM ' . _DB_PREFIX_ . 'product_attribute WHERE id_product = ' . (int) $product . ' LIMIT 1'); foreach ($result as $row) { if (Validate::isLoadedObject($product = new Product((int) $product))) { $product->deleteDefaultAttributes(); $product->setDefaultAttribute($row['id_product_attribute']); } } } // Delete associated restrictions on cart rules CartRule::cleanProductRuleIntegrity('attributes', $this->id); /* Reinitializing position */ $this->cleanPositions((int) $this->id_attribute_group); } $return = parent::delete(); if ($return) { Hook::exec('actionAttributeDelete', array('id_attribute' => $this->id)); } return $return; }
public function initializeContext() { global $smarty; // Clean all cache values Cache::clean('*'); Context::getContext()->shop = new Shop(1); Shop::setContext(Shop::CONTEXT_SHOP, 1); Configuration::loadConfiguration(); if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language)) { if ($id_lang = (int) Configuration::get('PS_LANG_DEFAULT')) { Context::getContext()->language = new Language($id_lang); } } if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country)) { if ($id_country = (int) Configuration::get('PS_COUNTRY_DEFAULT')) { Context::getContext()->country = new Country((int) $id_country); } } if (!isset(Context::getContext()->currency) || !Validate::isLoadedObject(Context::getContext()->currency)) { if ($id_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT')) { Context::getContext()->currency = new Currency((int) $id_currency); } } Context::getContext()->cart = new Cart(); Context::getContext()->employee = new Employee(1); if (!defined('_PS_SMARTY_FAST_LOAD_')) { define('_PS_SMARTY_FAST_LOAD_', true); } require_once _PS_ROOT_DIR_ . '/config/smarty.config.inc.php'; Context::getContext()->smarty = $smarty; }
/** * @see FrontController::postProcess() */ public function postProcess() { $cart = $this->context->cart; if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { Tools::redirect('index.php?controller=order&step=1'); } // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) { if ($module['name'] == 'bankpermata') { $authorized = true; break; } } if (!$authorized) { die($this->module->getTranslator()->trans('This payment method is not available.', array(), 'Modules.BankPermata.Shop')); } $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) { Tools::redirect('index.php?controller=order&step=1'); } $currency = $this->context->currency; $total = (double) $cart->getOrderTotal(true, Cart::BOTH); $mailVars = array('{bankpermata_owner}' => Configuration::get('BANK_PERMATA_OWNER'), '{bankpermata_details}' => nl2br(Configuration::get('BANK_PERMATA_DETAILS')), '{bankpermata_address}' => nl2br(Configuration::get('BANK_PERMATA_ADDRESS'))); $this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKPERMATA'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key); Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key); }
protected function changePassword() { $token = Tools::getValue('token'); $id_customer = (int) Tools::getValue('id_customer'); if ($email = Db::getInstance()->getValue('SELECT `email` FROM ' . _DB_PREFIX_ . 'customer c WHERE c.`secure_key` = \'' . pSQL($token) . '\' AND c.id_customer = ' . $id_customer)) { $customer = new Customer(); $customer->getByEmail($email); if (!Validate::isLoadedObject($customer)) { $this->errors[] = $this->trans('Customer account not found', array(), 'Shop.Notifications.Error'); } elseif (!$customer->active) { $this->errors[] = $this->trans('You cannot regenerate the password for this account.', array(), 'Shop.Notifications.Error'); } // Case if both password params not posted or different, then "change password" form is not POSTED, show it. if (!Tools::isSubmit('passwd') || !Tools::isSubmit('confirmation') || ($passwd = Tools::getValue('passwd')) !== ($confirmation = Tools::getValue('confirmation')) || !Validate::isPasswd($passwd) || !Validate::isPasswd($confirmation)) { // Check if passwords are here anyway, BUT does not match the password validation format if (Tools::isSubmit('passwd') || Tools::isSubmit('confirmation')) { $this->errors[] = $this->trans('The password and its confirmation do not match.', array(), 'Shop.Notifications.Error'); } $this->context->smarty->assign(['customer_email' => $customer->email, 'customer_token' => $token, 'id_customer' => $id_customer, 'reset_token' => Tools::getValue('reset_token')]); $this->setTemplate('customer/password-new'); } else { // Both password fields posted. Check if all is right and store new password properly. if (!Tools::getValue('reset_token') || strtotime($customer->last_passwd_gen . '+' . (int) Configuration::get('PS_PASSWD_TIME_FRONT') . ' minutes') - time() > 0) { Tools::redirect('index.php?controller=authentication&error_regen_pwd'); } else { // To update password, we must have the temporary reset token that matches. if ($customer->getValidResetPasswordToken() !== Tools::getValue('reset_token')) { $this->errors[] = $this->trans('The password change request expired. You should ask for a new one.', array(), 'Shop.Notifications.Error'); } else { try { $crypto = new Hashing(); } catch (\PrestaShop\PrestaShop\Adapter\CoreException $e) { $this->errors[] = $this->trans('An error occurred with your account, which prevents us from updating the new password. Please report this issue using the contact form.', array(), 'Shop.Notifications.Error'); return false; } $customer->passwd = $crypto->encrypt($password = Tools::getValue('passwd'), _COOKIE_KEY_); $customer->last_passwd_gen = date('Y-m-d H:i:s', time()); if ($customer->update()) { Hook::exec('actionPasswordRenew', array('customer' => $customer, 'password' => $password)); $customer->removeResetPasswordToken(); $customer->update(); $mail_params = ['{email}' => $customer->email, '{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname]; if (Mail::Send($this->context->language->id, 'password', Mail::l('Your new password'), $mail_params, $customer->email, $customer->firstname . ' ' . $customer->lastname)) { $this->context->smarty->assign(['customer_email' => $customer->email]); $this->success[] = $this->trans('Your password has been successfully reset and a confirmation has been sent to your email address: %s', array($customer->email), 'Shop.Notifications.Success'); $this->context->updateCustomer($customer); $this->redirectWithNotifications('index.php?controller=my-account'); } else { $this->errors[] = $this->trans('An error occurred while sending the email.', array(), 'Shop.Notifications.Error'); } } else { $this->errors[] = $this->trans('An error occurred with your account, which prevents us from updating the new password. Please report this issue using the contact form.', array(), 'Shop.Notifications.Error'); } } } } } else { $this->errors[] = $this->trans('We cannot regenerate your password with the data you\'ve submitted', array(), 'Shop.Notifications.Error'); } }
/** * Add several tags in database and link it to a product * * @param integer $id_lang Language id * @param integer $id_simpleblog_post Post id to link tags with * @param string|array $tag_list List of tags, as array or as a string with comas * @return boolean Operation success */ public static function addTags($id_lang, $id_simpleblog_post, $tag_list, $separator = ',') { if (!Validate::isUnsignedId($id_lang)) { return false; } if (!is_array($tag_list)) { $tag_list = array_filter(array_unique(array_map('trim', preg_split('#\\' . $separator . '#', $tag_list, null, PREG_SPLIT_NO_EMPTY)))); } $list = array(); if (is_array($tag_list)) { foreach ($tag_list as $tag) { if (!Validate::isGenericName($tag)) { return false; } $tag_obj = new SimpleBlogTag(null, $tag, (int) $id_lang); /* Tag does not exist in database */ if (!Validate::isLoadedObject($tag_obj)) { $tag_obj->name = $tag; $tag_obj->id_lang = (int) $id_lang; $tag_obj->add(); } if (!in_array($tag_obj->id, $list)) { $list[] = $tag_obj->id; } } } $data = ''; foreach ($list as $tag) { $data .= '(' . (int) $tag . ',' . (int) $id_simpleblog_post . '),'; } $data = rtrim($data, ','); $sql = 'INSERT INTO `' . _DB_PREFIX_ . 'simpleblog_post_tag` (`id_simpleblog_tag`, `id_simpleblog_post`) VALUES ' . $data; return Db::getInstance()->execute($sql); }
public function validateOrder($cart, $id_module, $id_order_status) { global $cookie; if (!Validate::isLoadedObject($cart)) { die(Tools::displayError()); } $currency = new Currency((int) $cart->id_currency); $order = new Order(); $order->id_cart = (int) $cart->id; $order->id_user = (int) $cart->id_user; $order->id_currency = (int) $cart->id_currency; $order->id_address = (int) $cart->id_address; $order->id_carrier = (int) $cart->id_carrier; $order->id_order_status = (int) $id_order_status; $order->id_module = (int) $id_module; $order->discount = floatval($cart->discount); $order->product_total = floatval($cart->getProductTotal()); $order->shipping_total = floatval($cart->getShippingTotal()); $order->amount = floatval($cart->getOrderTotal()); $order->conversion_rate = floatval($currency->conversion_rate); $order->track_number = "null"; if ($order->add()) { unset($cookie->id_cart); $this->currentOrder = $order->id; if ($id_order_status == 2) { $products = $cart->getProducts(); foreach ($products as $row) { Product::updateOrders($row['id_product']); } } return true; } return false; }
public function __construct($type = false) { parent::__construct(); // If type is sent, the cookie has to be delete if ($type) { unset($this->context->cookie->{self::$cookie_name}); $this->setExpressCheckoutType($type); } // Store back the PayPal data if present under the cookie if (isset($this->context->cookie->{self::$cookie_name})) { $paypal = unserialize($this->context->cookie->{self::$cookie_name}); foreach ($this->cookie_key as $key) { $this->{$key} = $paypal[$key]; } } $this->currency = new Currency((int) $this->context->cart->id_currency); if (!Validate::isLoadedObject($this->currency)) { $this->_errors[] = $this->l('Not a valid currency'); } if (count($this->_errors)) { return false; } $currency_decimals = is_array($this->currency) ? (int) $this->currency['decimals'] : (int) $this->currency->decimals; $this->decimals = $currency_decimals * _PS_PRICE_DISPLAY_PRECISION_; }
public function postProcess() { ${"GLOBALS"}["blpimnned"] = "id_order_seller"; $dbodbxes = "id_order"; ${${"GLOBALS"}["qusrvgm"]} = (int) Tools::getValue("id_order"); if (!$this->context->customer->isLogged() && !Tools::getValue("secure_key")) { Tools::redirect("index.php?controller=authentication&back=my-account"); } ${"GLOBALS"}["tvasln"] = "id_order"; $jpdhpfqcj = "id_order"; if (!(int) Configuration::get("PS_INVOICE")) { die(Tools::displayError("Invoices are disabled in this shop.")); } if (isset(${${"GLOBALS"}["qusrvgm"]}) && Validate::isUnsignedId(${$dbodbxes})) { ${${"GLOBALS"}["ymjzko"]} = new Order(${$jpdhpfqcj}); } if (!isset(${${"GLOBALS"}["ymjzko"]}) || !Validate::isLoadedObject(${${"GLOBALS"}["ymjzko"]})) { die(Tools::displayError("Invoice not found")); } ${${"GLOBALS"}["vewtbt"]} = AgileSellerManager::getObjectOwnerID("order", ${${"GLOBALS"}["tvasln"]}); ${${"GLOBALS"}["sokafjqdei"]} = AgileSellerManager::getLinkedSellerID($this->context->customer->id); if (${${"GLOBALS"}["blpimnned"]} != ${${"GLOBALS"}["sokafjqdei"]}) { die(Tools::displayError("You do not have permission to see this invoice")); } if (Tools::isSubmit("secure_key") && $order->secure_key != Tools::getValue("secure_key")) { die(Tools::displayError("You do not have permission to see this invoice")); } if (!OrderState::invoiceAvailable($order->getCurrentState()) && !$order->invoice_number) { die(Tools::displayError("No invoice available")); } $this->order = ${${"GLOBALS"}["ymjzko"]}; }
public function getModuleAssign($module_name = '', $name_hook = '') { //$module_id = 7 ; $id_hook = 21 ; if (!$module_name || !$name_hook) { return; } $module = Module::getInstanceByName($module_name); $module_id = $module->id; $id_hook = Hook::getIdByName($name_hook); $hook_name = $name_hook; if (!$module) { return; } $module_name = $module->name; if (Validate::isLoadedObject($module) && $module->id) { $array = array(); $array['id_hook'] = $id_hook; $array['module'] = $module_name; $array['id_module'] = $module->id; if (_PS_VERSION_ < "1.5") { return self::lofHookExec($hook_name, array(), $module->id, $array); } else { $hook_name = substr($hook_name, 7, strlen($hook_name)); return self::renderModuleByHookV15($hook_name, array(), $module->id, $array); } } return ''; }
public function install() { /* Before creating a new tab "AdminSelfUpgrade" we need to remove any existing "AdminUpgrade" tab (present in v1.4.4.0 and v1.4.4.1) */ if ($id_tab = Tab::getIdFromClassName('AdminUpgrade')) { $tab = new Tab((int) $id_tab); if (!$tab->delete()) { $this->_errors[] = sprintf($this->l('Unable to delete outdated AdminUpgrade tab %d'), (int) $id_tab); } } /* If the "AdminSelfUpgrade" tab does not exist yet, create it */ if (!($id_tab = Tab::getIdFromClassName('AdminSelfUpgrade'))) { $tab = new Tab(); $tab->class_name = 'AdminSelfUpgrade'; $tab->module = 'autoupgrade'; $tab->id_parent = (int) Tab::getIdFromClassName('AdminTools'); foreach (Language::getLanguages(false) as $lang) { $tab->name[(int) $lang['id_lang']] = '1-Click Upgrade'; } if (!$tab->save()) { return $this->_abortInstall($this->l('Unable to create the "AdminSelfUpgrade" tab')); } if (!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'logo.gif', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 't' . DIRECTORY_SEPARATOR . 'AdminSelfUpgrade.gif')) { return $this->_abortInstall(sprintf($this->l('Unable to copy logo.gif in %s'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 't' . DIRECTORY_SEPARATOR)); } } else { $tab = new Tab((int) $id_tab); } /* Update the "AdminSelfUpgrade" tab id in database or exit */ if (Validate::isLoadedObject($tab)) { Configuration::updateValue('PS_AUTOUPDATE_MODULE_IDTAB', (int) $tab->id); } else { return $this->_abortInstall($this->l('Unable to load the "AdminSelfUpgrade" tab')); } /* Check that the 1-click upgrade working directory is existing or create it */ $autoupgrade_dir = _PS_ADMIN_DIR_ . DIRECTORY_SEPARATOR . 'autoupgrade'; if (!file_exists($autoupgrade_dir) && !@mkdir($autoupgrade_dir, 0755)) { return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), $autoupgrade_dir)); } /* Make sure that the 1-click upgrade working directory is writeable */ if (!is_writable($autoupgrade_dir)) { return $this->_abortInstall(sprintf($this->l('Unable to write in the directory "%s"'), $autoupgrade_dir)); } /* If a previous version of ajax-upgradetab.php exists, delete it */ if (file_exists($autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php')) { @unlink($autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php'); } /* Then, try to copy the newest version from the module's directory */ if (!@copy(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php', $autoupgrade_dir . DIRECTORY_SEPARATOR . 'ajax-upgradetab.php')) { return $this->_abortInstall(sprintf($this->l('Unable to copy ajax-upgradetab.php in %s'), $autoupgrade_dir)); } /* Make sure that the XML config directory exists */ if (!file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml') && !@mkdir(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml', 0755)) { return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml')); } /* Create a dummy index.php file in the XML config directory to avoid directory listing */ if (!file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'index.php') && (file_exists(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php') && !@copy(_PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'index.php', _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml' . DIRECTORY_SEPARATOR . 'index.php'))) { return $this->_abortInstall(sprintf($this->l('Unable to create the directory "%s"'), _PS_ROOT_DIR_ . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'xml')); } return parent::install(); }
public function getAuthorisation() { global $cookie; // Getting cart informations $cart = new Cart(intval($cookie->id_cart)); if (!Validate::isLoadedObject($cart)) { $this->_logs[] = $this->l('Not a valid cart'); } $currency = new Currency(intval($cart->id_currency)); if (!Validate::isLoadedObject($currency)) { $this->_logs[] = $this->l('Not a valid currency'); } if (sizeof($this->_logs)) { return false; } // Making request $returnURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'modules/paypalapi/express/submit.php'; $cancelURL = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://') . htmlspecialchars($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8') . __PS_BASE_URI__ . 'order.php'; $paymentAmount = number_format(floatval($cart->getOrderTotalLC()), 2, '.', ''); $currencyCodeType = strval($currency->iso_code); $paymentType = 'Sale'; $request = '&Amt=' . urlencode($paymentAmount) . '&PAYMENTACTION=' . urlencode($paymentType) . '&ReturnUrl=' . urlencode($returnURL) . '&CANCELURL=' . urlencode($cancelURL) . '&CURRENCYCODE=' . urlencode($currencyCodeType); if ($this->_header) { $request .= '&HDRIMG=' . urlencode($this->_header); } // Calling PayPal API include _PS_MODULE_DIR_ . 'paypalapi/api/PaypalLib.php'; $ppAPI = new PaypalLib(); $result = $ppAPI->makeCall($this->getAPIURL(), $this->getAPIScript(), 'SetExpressCheckout', $request); $this->_logs = array_merge($this->_logs, $ppAPI->getLogs()); return $result; }
public function hookPayment($params) { $cart = $params['cart']; $customer = new Customer((int) $cart->id_customer); $deliveryAddress = new Address((int) $cart->id_address_delivery); $country = new Country((int) $deliveryAddress->id_country); $currency = Currency::getCurrencyInstance($this->context->cookie->id_currency); if (!Validate::isLoadedObject($currency)) { return false; } $phone = Tools::safeOutput($deliveryAddress->phone_mobile); if (empty($phone)) { $phone = Tools::safeOutput($deliveryAddress->phone); } $public_key = Configuration::get('SIMPLEPAY_LIVE_PUBLIC_KEY'); if ((int) Configuration::get('SIMPLEPAY_TEST_MODE')) { $public_key = Configuration::get('SIMPLEPAY_TEST_PUBLIC_KEY'); } $this->context->smarty->assign('email', $customer->email); $this->context->smarty->assign('phone', $phone); $this->context->smarty->assign('description', Configuration::get('SIMPLEPAY_PAYMENT_DESCRIPTION') . ' #' . $cart->id); $this->context->smarty->assign('address', Tools::safeOutput($deliveryAddress->address1 . ' ' . $deliveryAddress->address2)); $this->context->smarty->assign('postal_code', Tools::safeOutput($deliveryAddress->postcode)); $this->context->smarty->assign('city', Tools::safeOutput($deliveryAddress->city)); $this->context->smarty->assign('country', $country->iso_code); $this->context->smarty->assign('amount', $cart->getOrderTotal()); $this->context->smarty->assign('currency', $currency); $this->context->smarty->assign('public_key', $public_key); $this->context->smarty->assign('module_dir', $this->_path); $this->context->smarty->assign('cart_id', $cart->id); $this->context->smarty->assign('cart_id', $cart->id); $this->context->smarty->assign('image', Configuration::get('SIMPLEPAY_IMAGE')); return $this->display(__FILE__, 'views/templates/hook/payment.tpl'); }
/** * Add several tags in database and link it to a product * * @param integer $id_lang Language id * @param integer $id_product Product id to link tags with * @param string $string Tags separated by commas * * @return boolean Operation success */ public static function addTags($id_lang, $id_product, $string) { if (!Validate::isUnsignedId($id_lang) or Validate::isTagsList($string)) { Tools::displayError(); } $tmpTab = array_unique(array_map('trim', explode(',', $string))); $list = array(); foreach ($tmpTab as $tag) { if (!Validate::isGenericName($tag)) { return false; } $tagObj = new Tag(NULL, trim($tag), intval($id_lang)); /* Tag does not exist in database */ if (!Validate::isLoadedObject($tagObj)) { $tagObj->name = trim($tag); $tagObj->id_lang = intval($id_lang); $tagObj->add(); } if (!in_array($tagObj->id, $list)) { $list[] = $tagObj->id; } } $data = ''; foreach ($list as $tag) { $data .= '(' . intval($tag) . ',' . intval($id_product) . '),'; } $data = rtrim($data, ','); if (!Validate::isValuesList($list)) { Tools::displayError(); } return Db::getInstance()->Execute(' INSERT INTO `' . _DB_PREFIX_ . 'product_tag` (`id_tag`, `id_product`) VALUES ' . $data); }
function processOrderStep($params) { global $cart, $smarty, $errors, $isVirtualCart, $orderTotal; $cart->recyclable = (isset($_POST['recyclable']) and !empty($_POST['recyclable'])) ? 1 : 0; if (isset($_POST['gift']) and !empty($_POST['gift'])) { if (!Validate::isMessage($_POST['gift_message'])) { $errors[] = Tools::displayError('invalid gift message'); } else { $cart->gift = 1; $cart->gift_message = strip_tags($_POST['gift_message']); } } else { $cart->gift = 0; } $address = new Address(intval($cart->id_address_delivery)); if (!Validate::isLoadedObject($address)) { die(Tools::displayError()); } if (!($id_zone = Address::getZoneById($address->id))) { $errors[] = Tools::displayError('no zone match with your address'); } if (isset($_POST['id_carrier']) and Validate::isInt($_POST['id_carrier']) and sizeof(Carrier::checkCarrierZone(intval($_POST['id_carrier']), intval($id_zone)))) { $cart->id_carrier = intval($_POST['id_carrier']); } elseif (!$isVirtualCart) { $errors[] = Tools::displayError('invalid carrier or no carrier selected'); } Module::hookExec('extraCarrierDetailsProcess', array('carrier' => new Carrier($cart->id_carrier))); $cart->update(); }
/** * Initialize addresses controller * @see FrontController::init() */ public function init() { parent::init(); if (!Validate::isLoadedObject($this->context->customer)) { die(Tools::displayError('The customer could not be found.')); } }
public function postProcess() { global $currentIndex; $this->product = new Product(intval(Tools::getValue('id_product'))); if (isset($_POST['generate'])) { if (!is_array(Tools::getValue('options'))) { $this->_errors[] = Tools::displayError('You need to choose at least 1 attribute.'); } else { $tab = array_values($_POST['options']); if (sizeof($tab) and Validate::isLoadedObject($this->product)) { self::setAttributesImpacts($this->product->id, $tab); $this->combinations = array_values(self::createCombinations($tab)); $values = array_values(array_map(array($this, 'addAttribute'), $this->combinations)); $this->product->deleteProductAttributes(); $res = $this->product->addProductAttributeMultiple($values); $this->product->addAttributeCombinationMultiple($res, $this->combinations); } else { $this->_errors[] = Tools::displayError('Unable to initialize parameters, combinations is missing or object cannot be load.'); } } } elseif (isset($_POST['back'])) { Tools::redirectAdmin($currentIndex . '&id_product=' . intval(Tools::getValue('id_product')) . '&id_category=' . intval(Tools::getValue('id_category')) . '&addproduct' . '&tabs=2&token=' . Tools::getValue('token')); } parent::postProcess(); }
/** * @see FrontController::postProcess() */ public function postProcess() { $oplata = new Oplata(); if ($_POST['order_status'] == OplataCls::ORDER_DECLINED) { $this->errors[] = Tools::displayError('Order declined'); } $settings = array('merchant_id' => $oplata->getOption('merchant'), 'secret_key' => $oplata->getOption('secret_key')); $isPaymentValid = OplataCls::isPaymentValid($settings, $_POST); if ($isPaymentValid !== true) { $this->errors[] = Tools::displayError($isPaymentValid); } $cart = $this->context->cart; if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { Tools::redirect('index.php?controller=order&step=1'); } $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) { Tools::redirect('index.php?controller=order&step=1'); } if (empty($this->errors)) { list($orderId, ) = explode(OplataCls::ORDER_SEPARATOR, $_POST['order_id']); $history = new OrderHistory(); $history->id_order = $orderId; $history->changeIdOrderState((int) Configuration::get('PS_OS_PAYMENT'), $orderId); $history->addWithemail(true, array('order_name' => $orderId)); Tools::redirect('index.php?controller=order-confirmation&id_cart=' . $cart->id . '&id_module=' . $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key); } }
public function preProcess() { parent::preProcess(); $this->id_cart = (int) Tools::getValue('id_cart', 0); /* check if the cart has been made by a Guest customer, for redirect link */ if (Cart::isGuestCartByCartId($this->id_cart)) { $redirectLink = 'guest-tracking.php'; } else { $redirectLink = 'history.php'; } $this->id_module = (int) Tools::getValue('id_module', 0); $this->id_order = Order::getOrderByCartId((int) $this->id_cart); $this->secure_key = Tools::getValue('key', false); if (!$this->id_order or !$this->id_module or !$this->secure_key or empty($this->secure_key)) { Tools::redirect($redirectLink . (Tools::isSubmit('slowvalidation') ? '?slowvalidation' : '')); } $order = new Order((int) $this->id_order); if (!Validate::isLoadedObject($order) or $order->id_customer != self::$cookie->id_customer or $this->secure_key != $order->secure_key) { Tools::redirect($redirectLink); } $module = Module::getInstanceById((int) $this->id_module); if ($order->payment != $module->displayName) { Tools::redirect($redirectLink); } }
/** * @see FrontController::postProcess() */ public function postProcess() { // if status == "success" $cart = $this->context->cart; if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { Tools::redirect('index.php?controller=order&step=1'); } // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) { if ($module['name'] == 'tinklit') { $authorized = true; break; } } if (!$authorized) { die($this->module->l('This payment method is not available.', 'validation')); } $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) { Tools::redirect('index.php?controller=order&step=1'); } $currency = $this->context->currency; $total = (double) $cart->getOrderTotal(true, Cart::BOTH); $mailVars = array(); Tools::redirect('index.php?controller=order-confirmation&id_cart=' . (int) $cart->id . '&id_module=' . (int) $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key); }
public function process() { parent::process(); $multipleAddressesFormated = array(); $ordered_fields = array(); $customer = new Customer((int) self::$cookie->id_customer); if (!Validate::isLoadedObject($customer)) { die(Tools::displayError('Customer not found')); } // Retro Compatibility Theme < 1.4.1 self::$smarty->assign('addresses', $customer->getAddresses((int) self::$cookie->id_lang)); $customerAddressesDetailed = $customer->getAddresses((int) self::$cookie->id_lang); $total = 0; foreach ($customerAddressesDetailed as $addressDetailed) { $address = new Address($addressDetailed['id_address']); $multipleAddressesFormated[$total] = AddressFormat::getFormattedLayoutData($address); unset($address); ++$total; // Retro theme < 1.4.2 $ordered_fields = AddressFormat::getOrderedAddressFields($addressDetailed['id_country'], false, true); } // Retro theme 1.4.2 if ($key = array_search('Country:name', $ordered_fields)) { $ordered_fields[$key] = 'country'; } self::$smarty->assign('addresses_style', array('company' => 'address_company', 'vat_number' => 'address_company', 'firstname' => 'address_name', 'lastname' => 'address_name', 'address1' => 'address_address1', 'address2' => 'address_address2', 'city' => 'address_city', 'country' => 'address_country', 'phone' => 'address_phone', 'phone_mobile' => 'address_phone_mobile', 'alias' => 'address_title')); self::$smarty->assign(array('multipleAddresses' => $multipleAddressesFormated, 'ordered_fields' => $ordered_fields)); unset($customer); }
public function addSlipDetail($order_detail_list, $product_qty_list) { // start of implementation of the module code - taxamo $reg_taxamo_transaction = null; $last_id_order_transaction = Taxamoeuvat::getLastIdByOrder($this->id_order); if (!is_null($last_id_order_transaction)) { $reg_taxamo_transaction = Taxamoeuvat::idExistsTransaction((int) $last_id_order_transaction); } // end of code implementation module - taxamo foreach ($order_detail_list as $key => $id_order_detail) { if ($qty = (int) $product_qty_list[$key]) { $order_detail = new OrderDetail((int) $id_order_detail); // if (Validate::isLoadedObject($order_detail)) // Db::getInstance()->insert('order_slip_detail', array( // 'id_order_slip' => (int)$this->id, // 'id_order_detail' => (int)$id_order_detail, // 'product_quantity' => $qty, // 'amount_tax_excl' => $order_detail->unit_price_tax_excl * $qty, // 'amount_tax_incl' => $order_detail->unit_price_tax_incl * $qty // )); // start of implementation of the module code - taxamo // se comento el condicional y el insert anterior para incluir en el mismo condicional el llamado a la api de taxamo - refunds if (Validate::isLoadedObject($order_detail)) { Db::getInstance()->insert('order_slip_detail', array('id_order_slip' => (int) $this->id, 'id_order_detail' => (int) $id_order_detail, 'product_quantity' => $qty, 'amount_tax_excl' => $order_detail->unit_price_tax_excl * $qty, 'amount_tax_incl' => $order_detail->unit_price_tax_incl * $qty)); if (!is_null($reg_taxamo_transaction)) { Tools::taxamoRefunds($reg_taxamo_transaction[0]['key_transaction'], $order_detail->product_id, $order_detail->unit_price_tax_incl * $qty); } } // end of code implementation module - taxamo } } }
/** * Gets the list of supply order statuses * * @param int $id_state_referrer Optional, used to know what state is available after this one * @param int $id_lang Optional Id Language * @return array States */ public static function getSupplyOrderStates($id_state_referrer = null, $id_lang = null) { if ($id_lang == null) { $id_lang = Context::getContext()->language->id; } $query = new DbQuery(); $query->select('sl.name, s.id_supply_order_state'); $query->from('supply_order_state', 's'); $query->leftjoin('supply_order_state_lang', 'sl', 's.id_supply_order_state = sl.id_supply_order_state AND sl.id_lang=' . (int) $id_lang); if (!is_null($id_state_referrer)) { $is_receipt_state = false; $is_editable = false; $is_delivery_note = false; $is_pending_receipt = false; //check current state to see what state is available $state = new SupplyOrderState((int) $id_state_referrer); if (Validate::isLoadedObject($state)) { $is_receipt_state = $state->receipt_state; $is_editable = $state->editable; $is_delivery_note = $state->delivery_note; $is_pending_receipt = $state->pending_receipt; } $query->where('s.id_supply_order_state <> ' . (int) $id_state_referrer); //check first if the order is editable if ($is_editable) { $query->where('s.editable = 1 OR s.delivery_note = 1 OR s.enclosed = 1'); } elseif ($is_delivery_note || $is_pending_receipt) { $query->where('(s.delivery_note = 0 AND s.editable = 0) OR s.enclosed = 1'); } elseif ($is_receipt_state) { $query->where('s.receipt_state = 1'); } } return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); }
public function render($data = NULL) { if (!isset($data)) { $data = $this->getData(); } if (isset($this->_disabled_categories) && !empty($this->_disabled_categories)) { $this->_disableCategories($data, $this->getDisabledCategories()); } if (isset($this->_selected_categories) && !empty($this->_selected_categories)) { $this->_getSelectedChildNumbers($data, $this->getSelectedCategories()); } //Default bootstrap style of search is push-right, so we add this button first if ($this->useSearch()) { $this->addAction(new TreeToolbarSearchCategories('Find a category:', $this->getId() . '-categories-search')); $this->setAttribute('use_search', $this->useSearch()); } $collapse_all = new TreeToolbarLink('Collapse All', '#', '$(\'#' . $this->getId() . '\').tree(\'collapseAll\');$(\'#collapse-all-' . $this->getId() . '\').hide();$(\'#expand-all-' . $this->getId() . '\').show(); return false;', 'icon-collapse-alt'); $collapse_all->setAttribute('id', 'collapse-all-' . $this->getId()); $expand_all = new TreeToolbarLink('Expand All', '#', '$(\'#' . $this->getId() . '\').tree(\'expandAll\');$(\'#collapse-all-' . $this->getId() . '\').show();$(\'#expand-all-' . $this->getId() . '\').hide(); return false;', 'icon-expand-alt'); $expand_all->setAttribute('id', 'expand-all-' . $this->getId()); $this->addAction($collapse_all); $this->addAction($expand_all); if ($this->useCheckBox()) { $check_all = new TreeToolbarLink('Check All', '#', 'checkAllAssociatedCategories($(\'#' . $this->getId() . '\')); return false;', 'icon-check-sign'); $check_all->setAttribute('id', 'check-all-' . $this->getId()); $uncheck_all = new TreeToolbarLink('Uncheck All', '#', 'uncheckAllAssociatedCategories($(\'#' . $this->getId() . '\')); return false;', 'icon-check-empty'); $uncheck_all->setAttribute('id', 'uncheck-all-' . $this->getId()); $this->addAction($check_all); $this->addAction($uncheck_all); $this->setNodeFolderTemplate('tree_node_folder_checkbox.tpl'); $this->setNodeItemTemplate('tree_node_item_checkbox.tpl'); $this->setAttribute('use_checkbox', $this->useCheckBox()); } $this->setAttribute('selected_categories', $this->getSelectedCategories()); $this->getContext()->smarty->assign('root_category', Configuration::get('PS_ROOT_CATEGORY')); /* Tree class render() function */ //Adding tree.js $admin_webpath = str_ireplace(_PS_CORE_DIR_, '', _PS_ADMIN_DIR_); $admin_webpath = preg_replace('/^' . preg_quote(DIRECTORY_SEPARATOR, '/') . '/', '', $admin_webpath); $bo_theme = Validate::isLoadedObject($this->getContext()->employee) && $this->getContext()->employee->bo_theme ? $this->getContext()->employee->bo_theme : 'default'; if (!file_exists(_PS_BO_ALL_THEMES_DIR_ . $bo_theme . DIRECTORY_SEPARATOR . 'template')) { $bo_theme = 'default'; } $js_path = __PS_BASE_URI__ . $admin_webpath . '/themes/' . $bo_theme . '/js/tree.js'; if ($this->getContext()->controller->ajax) { $html = '<script type="text/javascript" src="' . $js_path . '"></script>'; } else { $this->getContext()->controller->addJs($js_path); } //Create Tree Template $template = $this->getContext()->smarty; if (trim($this->getTitle()) != '' || $this->useToolbar()) { //Create Tree Header Template $headerTemplate = $this->getContext()->smarty->createTemplate($this->getTemplateFile($this->getHeaderTemplate()), $this->getContext()->smarty); $headerTemplate->assign($this->getAttributes())->assign(array('title' => $this->getTitle(), 'toolbar' => $this->useToolbar() ? $this->renderToolbar() : null)); $template->assign('header', $headerTemplate->fetch()); } //Assign Tree nodes $template->assign($this->getAttributes())->assign(array('id' => $this->getId(), 'nodes' => $this->renderNodes($data))); }
public function postProcess() { $cart = $this->context->cart; if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) { Tools::redirect('index.php?controller=order&step=1'); } // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) { if ($module['name'] == 'cheque') { $authorized = true; break; } } if (!$authorized) { die($this->module->l('This payment method is not available.', 'validation')); } $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) { Tools::redirect('index.php?controller=order&step=1'); } $currency = $this->context->currency; $total = (double) $cart->getOrderTotal(true, Cart::BOTH); $mailVars = array('{cheque_name}' => Configuration::get('CHEQUE_NAME'), '{cheque_address}' => Configuration::get('CHEQUE_ADDRESS'), '{cheque_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS'))); $this->module->validateOrder((int) $cart->id, Configuration::get('PS_OS_CHEQUE'), $total, $this->module->displayName, NULL, $mailVars, (int) $currency->id, false, $customer->secure_key); Tools::redirect('index.php?controller=order-confirmation&id_cart=' . (int) $cart->id . '&id_module=' . (int) $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key); }
public function postProcess() { global $cookie; $this->tabAccess = Profile::getProfileAccess($cookie->profile, $this->id); if (Tools::isSubmit('submitAdd' . $this->table)) { if ($id_category = intval(Tools::getValue('id_category'))) { if (!Category::checkBeforeMove($id_category, intval(Tools::getValue('id_parent')))) { $this->_errors[] = Tools::displayError('category cannot be moved here'); return false; } // Updating customer's group if ($this->tabAccess['edit'] !== '1') { $this->_errors[] = Tools::displayError('You do not have permission to edit anything here.'); } else { $object = new $this->className($id_category); if (Validate::isLoadedObject($object)) { $object->updateGroup(Tools::getValue('groupBox')); } else { $this->_errors[] = Tools::displayError('an error occurred while updating object') . ' <b>' . $this->table . '</b> ' . Tools::displayError('(cannot load object)'); } } } } parent::postProcess(); }
/** * Initialize cms controller * @see FrontController::init() */ public function init() { if ($id_cms = (int) Tools::getValue('id_cms')) { $this->cms = new CMS($id_cms, $this->context->language->id); } elseif ($id_cms_category = (int) Tools::getValue('id_cms_category')) { $this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id); } if (Configuration::get('PS_SSL_ENABLED') && Tools::getValue('content_only') && Tools::getValue('id_cms') == (int) Configuration::get('PS_CONDITIONS_CMS_ID') && Validate::isLoadedObject($this->cms)) { $this->ssl = true; } parent::init(); $this->canonicalRedirection(); // assignCase (1 = CMS page, 2 = CMS category) if (Validate::isLoadedObject($this->cms)) { $adtoken = Tools::getAdminToken('AdminCmsContent' . (int) Tab::getIdFromClassName('AdminCmsContent') . (int) Tools::getValue('id_employee')); if (!$this->cms->isAssociatedToShop() || !$this->cms->active && Tools::getValue('adtoken') != $adtoken) { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); } else { $this->assignCase = 1; } } elseif (Validate::isLoadedObject($this->cms_category)) { $this->assignCase = 2; } else { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); } }
public function process() { if ($id_supplier = Tools::getValue('id_supplier')) { $this->supplier = new Supplier((int) $id_supplier, self::$cookie->id_lang); if (Validate::isLoadedObject($this->supplier) and $this->supplier->active) { $nbProducts = $this->supplier->getProducts($id_supplier, NULL, NULL, NULL, $this->orderBy, $this->orderWay, true); $this->pagination((int) $nbProducts); self::$smarty->assign(array('nb_products' => $nbProducts, 'products' => $this->supplier->getProducts($id_supplier, (int) self::$cookie->id_lang, (int) $this->p, (int) $this->n, $this->orderBy, $this->orderWay), 'path' => $this->supplier->active ? Tools::safeOutput($this->supplier->name) : '', 'supplier' => $this->supplier)); } else { header('HTTP/1.1 404 Not Found'); header('Status: 404 Not Found'); $this->errors[] = Tools::displayError('Supplier does not exist'); } } else { if (Configuration::get('PS_DISPLAY_SUPPLIERS')) { $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true); $nbProducts = count($data); $this->pagination($nbProducts); $data = call_user_func(array('Supplier', 'getSuppliers'), true, (int) self::$cookie->id_lang, true, $this->p, $this->n); $imgDir = _PS_MANU_IMG_DIR_; foreach ($data as &$item) { $item['image'] = !file_exists($imgDir . '/' . $item['id_supplier'] . '-medium.jpg') ? Language::getIsoById((int) self::$cookie->id_lang) . '-default' : $item['id_supplier']; } self::$smarty->assign(array('pages_nb' => ceil($nbProducts / (int) $this->n), 'nbSuppliers' => $nbProducts, 'mediumSize' => Image::getSize('medium'), 'suppliers' => $data, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'))); } else { self::$smarty->assign('nbSuppliers', 0); } } }
public function postProcess() { if ($this->context->cart->id_customer == 0 || $this->context->cart->id_address_delivery == 0 || $this->context->cart->id_address_invoice == 0 || !$this->module->active) { Tools::redirectLink(__PS_BASE_URI__ . 'order.php?step=1'); } // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) { if ($module['name'] == 'cashondelivery') { $authorized = true; break; } } // if (!$authorized) // die(Tools::displayError('This payment method is not available.')); $customer = new Customer($this->context->cart->id_customer); if (!Validate::isLoadedObject($customer)) { Tools::redirectLink(__PS_BASE_URI__ . 'order.php?step=1'); } if (Tools::getValue('confirm')) { $customer = new Customer((int) $this->context->cart->id_customer); $total = $this->context->cart->getOrderTotal(true, Cart::BOTH); $this->module->validateOrder((int) $this->context->cart->id, Configuration::get('PS_OS_PREPARATION'), $total, $this->module->displayName, null, array(), null, false, $customer->secure_key); Tools::redirectLink(__PS_BASE_URI__ . 'order-confirmation.php?key=' . $customer->secure_key . '&id_cart=' . (int) $this->context->cart->id . '&id_module=' . (int) $this->module->id . '&id_order=' . (int) $this->module->currentOrder); } }
public function renderForm() { if (!$this->loadObject(true)) { if (Validate::isLoadedObject($this->object)) { $this->display = 'edit'; } else { $this->display = 'add'; } } $this->initToolbar(); $this->initPageHeaderToolbar(); //$id_leoblogcat = (int) (Tools::getValue('id_leoblogcat')); //$obj = new leoblogcat($id_leoblogcat); //$tree = $obj->getTree(); //$menus = $obj->getDropdown(null, $obj->id_parent); $blog = new LeoBlogBlog($this->object->id_leoblog_blog, $this->context->language->id); $this->multiple_fieldsets = true; $this->object->blog_title = $blog->meta_title; $this->fields_form[0]['form'] = array('tinymce' => true, 'legend' => array('title' => $this->l('Blog Form'), 'icon' => 'icon-folder-close'), 'input' => array(array('type' => 'hidden', 'label' => $this->l('Comment ID'), 'name' => 'id_comment'), array('type' => 'text', 'label' => $this->l('Blog Title'), 'name' => 'blog_title'), array('type' => 'text', 'label' => $this->l('User'), 'name' => 'user'), array('type' => 'text', 'label' => $this->l('Email'), 'name' => 'email'), array('type' => 'textarea', 'label' => $this->l('Blog Content'), 'name' => 'comment', 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'switch', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled'))))), 'submit' => array('title' => $this->l('Save'), 'class' => 'btn btn-default')); $this->tpl_form_vars = array('active' => $this->object->active, 'PS_ALLOW_ACCENTED_CHARS_URL', (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')); $html = ' <script type="text/javascript"> var PS_ALLOW_ACCENTED_CHARS_URL = ' . (int) Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') . '; </script> '; return $html . parent::renderForm(); }