本文整理汇总了PHP中ModuleFrontController::postProcess方法的典型用法代码示例。如果您正苦于以下问题:PHP ModuleFrontController::postProcess方法的具体用法?PHP ModuleFrontController::postProcess怎么用?PHP ModuleFrontController::postProcess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ModuleFrontController
的用法示例。
在下文中一共展示了ModuleFrontController::postProcess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
public function postProcess()
{
parent::postProcess();
$this->log_on = Configuration::get('YA_P2P_LOGGING_ON');
$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');
}
$this->module->payment_status = false;
$requestId = base64_decode(urldecode($this->context->cookie->ya_encrypt_CRequestId));
$token = base64_decode(urldecode($this->context->cookie->ya_encrypt_token));
$res = new stdClass();
$res->status = Tools::getValue('status');
$res->error = Tools::getValue('reason');
if (!empty($requestId)) {
if ($res->status == 'success') {
$this->updateStatus($res);
$this->error = false;
} else {
$this->error = true;
$this->errors[] = $this->module->descriptionError($res->error);
}
} else {
$this->errors[] = $this->module->l('Получены не верные данные от сервиса Яндекс.Деньги');
if ($this->log_on) {
$this->module->log_save('payment_card: Error ' . $this->module->l('invalid send data'));
}
return;
}
}
示例2: postProcess
public function postProcess()
{
parent::postProcess();
$this->log_on = Configuration::get('YA_P2P_LOGGING_ON');
$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');
}
$this->module->payment_status = false;
$requestId = $this->module->cryptor->decrypt(urldecode($this->context->cookie->ya_encrypt_CRequestId));
$res = new stdClass();
Tools::p($_REQUEST);
$res->status = Tools::getValue('status');
$res->error = Tools::getValue('reason');
if (!empty($requestId)) {
if ($res->status == 'success') {
$this->updateStatus($res);
$this->error = false;
} else {
$this->error = true;
$this->errors[] = $this->module->descriptionError($res->error);
}
} else {
$this->errors[] = $this->module->l('Not received the correct data from Yandex.Money');
if ($this->log_on) {
$this->module->logSave('payment_card: Error ' . $this->module->l('Invalid send data'));
}
return;
}
}
示例3: postProcess
public function postProcess()
{
parent::postProcess();
if (Tools::getValue('cron') == 1) {
$this->module->generateXML(true);
die('OK');
} else {
$this->module->generateXML(false);
}
}
示例4: postProcess
public function postProcess()
{
parent::postProcess();
//ИД заказа
$ordernumber = Tools::getValue('InvId');
//Сумма заказа
$amount = Tools::getValue('OutSum');
$signature = md5($amount . ':' . $ordernumber . ':' . Configuration::get('robokassa_password2'));
//Проверка подписи
if (strtoupper($signature) != Tools::getValue('SignatureValue')) {
robokassa::validateAnsver($this->module->l('Invalid signature'));
}
if (Configuration::get('robokassa_postvalidate')) {
$cart = new Cart((int) $ordernumber);
//Проверка существования заказа
if (!Validate::isLoadedObject($cart)) {
robokassa::validateAnsver($this->module->l('Cart does not exist'));
}
$total_to_pay = $cart->getOrderTotal(true, Cart::BOTH);
$currency_rub = new Currency(Currency::getIdByIsoCode('RUB'));
if ($cart->id_currency != $currency_rub->id) {
$currency = new Currency($cart->id_currency);
$total_to_pay = $total_to_pay / $currency->conversion_rate * $currency_rub->conversion_rate;
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
//Проверка суммы заказа
if ($amount != $total_to_pay) {
robokassa::validateAnsver($this->module->l('Incorrect payment summ'));
}
$this->module->validateOrder((int) $cart->id, Configuration::get('PS_OS_PAYMENT'), $cart->getOrderTotal(true, Cart::BOTH), $this->module->displayName, NULL, array(), NULL, false, $cart->secure_key);
} else {
$order = new Order((int) $ordernumber);
//Проверка существования заказа
if (!Validate::isLoadedObject($order)) {
robokassa::validateAnsver($this->module->l('Order does not exist'));
}
$total_to_pay = $order->total_paid;
$currency_rub = new Currency(Currency::getIdByIsoCode('RUB'));
if ($order->id_currency != $currency_rub->id) {
$currency = new Currency($order->id_currency);
$total_to_pay = $total_to_pay / $currency->conversion_rate * $currency_rub->conversion_rate;
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
//Проверка суммы заказа
if ($amount != $total_to_pay) {
robokassa::validateAnsver($this->module->l('Incorrect payment summ'));
}
//Меняем статус заказа
$history = new OrderHistory();
$history->id_order = $ordernumber;
$history->changeIdOrderState(Configuration::get('PS_OS_PAYMENT'), $ordernumber);
$history->addWithemail(true);
}
die('OK' . $ordernumber);
}
示例5: postProcess
/**
* Post data process function
*/
public function postProcess()
{
parent::postProcess();
$this->_createNotification($_POST);
$this->_createCredential();
$this->_inicializeObjects();
if ($this->obj_notification_type->getValue() == $this->notification_type) {
$this->_createTransaction();
}
if ($this->obj_transaction) {
$this->_updateCms();
}
}
示例6: postProcess
public function postProcess()
{
parent::postProcess();
$log_on = Configuration::get('YA_P2P_LOGGING_ON');
$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');
}
$this->myCart = $this->context->cart;
$total_to_pay = $cart->getOrderTotal(true);
$rub_currency_id = Currency::getIdByIsoCode('RUB');
if ($cart->id_currency != $rub_currency_id) {
$from_currency = new Currency($cart->id_currency);
$to_currency = new Currency($rub_currency_id);
$total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
}
if ($total_to_pay > 0 && $total_to_pay < 1) {
$total_to_pay_limit = '1.00';
} else {
$total_to_pay_limit = number_format($total_to_pay, 2, '.', '');
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
$this->module->payment_status = '';
$code = Tools::getValue('code');
$type = Tools::getValue('type');
if (empty($code)) {
$scope = array("payment.to-account(\"" . Configuration::get('YA_P2P_NUMBER') . "\",\"account\").limit(," . $total_to_pay_limit . ")", "money-source(\"wallet\",\"card\")");
if ($type == 'wallet') {
if ($log_on) {
$this->module->log_save('p2p_redirect: ' . $this->module->l('Type wallet'));
}
$auth_url = API::buildObtainTokenUrl(Configuration::get('YA_P2P_IDENTIFICATOR'), $this->context->link->getModuleLink('yamodule', 'redirect_wallet', array(), true), $scope);
} elseif ($type == 'card') {
if ($log_on) {
$this->module->log_save('redirect: ' . $this->module->l('Type card'));
}
Tools::redirect($this->context->link->getModuleLink('yamodule', 'redirect_card', array('code' => true, 'cnf' => true), true), '');
}
if ($log_on) {
$this->module->log_save('p2p_redirect: url = ' . $auth_url);
}
Tools::redirect($auth_url, '');
}
}
示例7: postProcess
public function postProcess()
{
parent::postProcess();
$type = Tools::getValue('type');
$func = Tools::getValue('func');
$arr = array($type, $func);
$arr = array_merge($arr, $_REQUEST);
$dd = serialize($arr);
$this->module->logSave('pokupki ' . $dd);
$key = Tools::getValue('auth-token');
$sign = Configuration::get('YA_POKUPKI_TOKEN');
if (Tools::strtoupper($sign) != Tools::strtoupper($key)) {
header('HTTP/1.1 403 Forbidden');
header('Status: 403 Forbidden');
echo '<h1>Wrong token</h1>';
exit;
} else {
$json = Tools::file_get_contents("php://input");
$this->module->logSave('pokupki' . $json);
if (!$json) {
header('HTTP/1.1 403 Forbidden');
header('Status: 403 Forbidden');
echo '<h1>No data posted</h1>';
exit;
} else {
header('Content-type:application/json; charset=utf-8');
$partner = new Partner();
$data = Tools::jsonDecode($json);
if ($type == 'cart') {
$partner->requestItems($data);
} elseif ($type == 'order') {
if ($func == 'accept') {
$partner->orderAccept($data);
} elseif ($func == 'status') {
$partner->alertOrderStatus($data);
}
} else {
header('HTTP/1.0 404 Not Found');
echo '<h1>Wrong controller</h1>';
exit;
}
}
}
}
示例8: postProcess
public function postProcess()
{
parent::postProcess();
if (Tools::getIsset('token')) {
if (Tools::getValue('token') == 'tiskwoalea') {
$this->mod = Module::getInstanceByName('tomcategorysearch');
if (Tools::getValue('tcsearchdata') != '') {
$this->idcate = Tools::getValue('sfcategory');
$this->searchtext = Tools::getValue('tcsearchdata');
$this->searchProductTable();
} else {
echo 'Nothing found';
exit;
}
}
}
// print_r($_POST);
//exit;
}
示例9: postProcess
public function postProcess()
{
parent::postProcess();
$this->module->generate(Tools::getValue('cron'));
}
示例10: postProcess
public function postProcess()
{
parent::postProcess();
$this->log_on = Configuration::get('YA_P2P_LOGGING_ON');
$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');
}
$this->myCart = $this->context->cart;
$total_to_pay = $cart->getOrderTotal(true);
$rub_currency_id = Currency::getIdByIsoCode('RUB');
if ($cart->id_currency != $rub_currency_id) {
$from_currency = new Currency($cart->id_currency);
$to_currency = new Currency($rub_currency_id);
$total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
}
if ($total_to_pay > 0 && $total_to_pay < 1) {
$total_to_pay_limit = '1.00';
} else {
$total_to_pay_limit = number_format($total_to_pay, 2, '.', '');
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
$this->module->payment_status = false;
$code = Tools::getValue('code');
$cnf = Tools::getValue('cnf');
if (empty($code)) {
Tools::redirect('index.php?controller=order&step=3');
} elseif (!empty($code) && $cnf) {
$comment = $message = $this->module->l('total:') . $total_to_pay . $this->module->l(' rub');
$response = ExternalPayment::getInstanceId(Configuration::get('YA_P2P_IDENTIFICATOR'));
if ($response->status == "success") {
if ($this->log_on) {
$this->module->log_save('card_redirect: ' . $this->module->l('get instance success'));
}
$instance_id = $response->instance_id;
$external_payment = new ExternalPayment($instance_id);
$payment_options = array("pattern_id" => "p2p", "to" => Configuration::get('YA_P2P_NUMBER'), "amount_due" => $total_to_pay, "comment" => trim($comment), "message" => trim($message), "label" => $this->context->cart->id);
$response = $external_payment->request($payment_options);
if ($response->status == "success") {
if ($this->log_on) {
$this->module->log_save('card_redirect: ' . $this->module->l('request success'));
}
$request_id = $response->request_id;
$this->context->cookie->ya_encrypt_CRequestId = urlencode(base64_encode($request_id));
$this->context->cookie->write();
do {
$process_options = array("request_id" => $request_id, 'ext_auth_success_uri' => $this->context->link->getModuleLink('yamodule', 'payment_card', array(), true), 'ext_auth_fail_uri' => $this->context->link->getModuleLink('yamodule', 'payment_card', array(), true));
$result = $external_payment->process($process_options);
if ($result->status == "in_progress") {
sleep(1);
}
} while ($result->status == "in_progress");
if ($result->status == 'success') {
$this->updateStatus($res);
$this->error = false;
} elseif ($result->status == 'ext_auth_required') {
$url = sprintf("%s?%s", $result->acs_uri, http_build_query($result->acs_params));
if ($this->log_on) {
$this->module->log_save('card_redirect: ' . $this->module->l('redirect to') . ' ' . $url);
}
Tools::redirect($url, '');
exit;
} elseif ($result->status == 'refused') {
$this->errors[] = $this->module->descriptionError($resp->error) ? $this->module->descriptionError($resp->error) : $result->error;
if ($this->log_on) {
$this->module->log_save('card_redirect:refused ' . $this->module->descriptionError($resp->error) ? $this->module->descriptionError($resp->error) : $result->error);
}
$this->module->payment_status = 102;
}
}
}
}
}
示例11: postProcess
public function postProcess()
{
parent::postProcess();
$dd = serialize($_REQUEST);
$this->log_on = Configuration::get('YA_ORG_LOGGING_ON');
if ($this->log_on) {
$this->module->log_save('payment_kassa ' . $dd);
}
Tools::getValue('label') ? $data = explode('_', Tools::getValue('label')) : ($data = explode('_', Tools::getValue('customerNumber')));
if (!empty($data) && $data[0] == 'KASSA') {
$cart = new Cart($data[1]);
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');
}
$total_to_pay = $cart->getOrderTotal(true);
$rub_currency_id = Currency::getIdByIsoCode('RUB');
if ($cart->id_currency != $rub_currency_id) {
$from_currency = new Currency($cart->id_currency);
$to_currency = new Currency($rub_currency_id);
$total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
$amount = Tools::getValue('orderSumAmount');
$action = Tools::getValue('action');
$shopId = Tools::getValue('shopId');
$invoiceId = Tools::getValue('invoiceId');
$signature = md5($action . ';' . $amount . ';' . Tools::getValue('orderSumCurrencyPaycash') . ';' . Tools::getValue('orderSumBankPaycash') . ';' . $shopId . ';' . $invoiceId . ';' . Tools::getValue('customerNumber') . ';' . trim(Configuration::get('YA_ORG_MD5_PASSWORD')));
$ord = $cart->orderExists() ? new Order((int) Order::getOrderByCartId($cart->id)) : $this->module->validateOrder($cart->id, _PS_OS_PREPARATION_, $cart->getOrderTotal(true, Cart::BOTH), $this->module->displayName, NULL, array(), NULL, false, $cart->secure_key);
if (!$ord) {
$this->module->validateResponse($this->module->l('Invalid order number'), 1, $action, $shopId, $invoiceId, true);
}
if (Tools::strtoupper($signature) != Tools::strtoupper(Tools::getValue('md5'))) {
$this->module->validateResponse($this->module->l('Invalid signature'), 1, $action, $shopId, $invoiceId, true);
}
if ($amount != $total_to_pay) {
$this->module->validateResponse($this->module->l('Incorrect payment amount'), $action == 'checkOrder' ? 100 : 200, $action, $shopId, $invoiceId, true);
}
if ($action == 'checkOrder') {
if ($this->log_on) {
$this->module->log_save('payment_kassa: checkOrder invoiceId="' . $invoiceId . '" shopId="' . $shopId . '" ' . $this->module->l('check order'));
}
$this->module->validateResponse('', 0, $action, $shopId, $invoiceId, true);
}
if ($action == 'paymentAviso') {
$history = new OrderHistory();
$history->id_order = $ord->id;
$history->changeIdOrderState(Configuration::get('PS_OS_PAYMENT'), $ord->id);
$history->addWithemail(true);
if ($this->log_on) {
$this->module->log_save('payment_kassa: paymentAviso invoiceId="' . $invoiceId . '" shopId="' . $shopId . '" #' . $ord->id . ' ' . $this->module->l('Order success'));
}
$this->module->validateResponse('', 0, $action, $shopId, $invoiceId, true);
}
} else {
Tools::redirect('index.php?controller=order&step=3');
}
}
示例12: postProcess
public function postProcess()
{
parent::postProcess();
}
示例13: postProcess
public function postProcess()
{
parent::postProcess();
$this->log_on = Configuration::get('YA_P2P_LOGGING_ON');
$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');
}
$this->myCart = $this->context->cart;
$total_to_pay = $cart->getOrderTotal(true);
$rub_currency_id = Currency::getIdByIsoCode('RUB');
if ($cart->id_currency != $rub_currency_id) {
$from_currency = new Currency($cart->id_currency);
$to_currency = new Currency($rub_currency_id);
$total_to_pay = Tools::convertPriceFull($total_to_pay, $from_currency, $to_currency);
}
if ($total_to_pay > 0 && $total_to_pay < 1) {
$total_to_pay_limit = '1.00';
} else {
$total_to_pay_limit = number_format($total_to_pay, 2, '.', '');
}
$total_to_pay = number_format($total_to_pay, 2, '.', '');
$this->module->payment_status = false;
$code = Tools::getValue('code');
$cnf = Tools::getValue('cnf');
if (empty($code)) {
Tools::redirect('index.php?controller=order&step=3');
} elseif (!empty($code) && $cnf) {
$comment = $message = $this->module->l('total:') . $total_to_pay . $this->module->l(' rub');
$response = API::getAccessToken(Configuration::get('YA_P2P_IDENTIFICATOR'), $code, $this->context->link->getModuleLink('yamodule', 'redirect', array(), true), Configuration::get('YA_P2P_KEY'));
$token = $response->access_token;
if ($token == '') {
$scope = array("payment.to-account(\"" . Configuration::get('YA_P2P_NUMBER') . "\",\"account\").limit(," . $total_to_pay_limit . ")", "money-source(\"wallet\",\"card\")");
if ($this->log_on) {
$this->module->log_save('wallet_redirect: ' . $this->module->l('Type wallet'));
}
$auth_url = API::buildObtainTokenUrl(Configuration::get('YA_P2P_IDENTIFICATOR'), $this->context->link->getModuleLink('yamodule', 'redirect_wallet', array(), true), $scope);
if ($this->log_on) {
$this->module->log_save('wallet_redirect: url = ' . $auth_url);
}
Tools::redirect($auth_url, '');
}
$api = new API($token);
$rarray = array('pattern_id' => 'p2p', 'to' => Configuration::get('YA_P2P_NUMBER'), 'amount_due' => $total_to_pay, 'comment' => trim($comment), 'message' => trim($message), 'label' => $this->context->cart->id);
$request_payment = $api->requestPayment($rarray);
switch ($request_payment->status) {
case 'success':
if ($this->log_on) {
$this->module->log_save('wallet_redirect: ' . $this->module->l('request success'));
}
$this->context->cookie->ya_encrypt_token = urlencode(base64_encode($token));
$this->context->cookie->ya_encrypt_RequestId = urlencode(base64_encode($request_payment->request_id));
$this->context->cookie->write();
$this->module->payment_link = $this->context->link->getModuleLink('yamodule', 'redirect', array(), true);
do {
$process_payment = $api->processPayment(array("request_id" => $request_payment->request_id));
if ($process_payment->status == "in_progress") {
sleep(1);
}
} while ($process_payment->status == "in_progress");
$this->updateStatus($process_payment);
$this->error = false;
break;
case 'refused':
if ($this->log_on) {
$this->module->log_save('wallet_redirect: ' . $this->module->l('request refused'));
}
$this->errors[] = $this->module->descriptionError($request_payment->error);
if ($this->log_on) {
$this->module->log_save('wallet_redirect: refused ' . $this->module->descriptionError($request_payment->error));
}
$this->error = true;
break;
case 'hold_for_pickup':
if ($this->log_on) {
$this->module->log_save('wallet_redirect: ' . $this->module->l('hold_for_pickup'));
}
$this->errors[] = $this->module->l('Получатель перевода не найден, будет отправлен перевод до востребования. Успешное выполнение.');
if ($this->log_on) {
$this->module->log_save('wallet_redirect: hold_for_pickup ' . $this->module->l('Получатель перевода не найден, будет отправлен перевод до востребования. Успешное выполнение.'));
}
$this->error = true;
break;
}
}
}
示例14: postProcess
public function postProcess()
{
$errors = array();
$confirmation = '1';
if (Tools::isSubmit('submitNewComment') && Tools::getValue('id_simpleblog_post')) {
$SimpleBlogPost = $this->SimpleBlogPost;
if (Configuration::get('PH_BLOG_COMMENT_ALLOW_GUEST') && Configuration::get('PH_BLOG_COMMENTS_RECAPTCHA')) {
if (!class_exists('ReCaptcha') && file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/assets/recaptchalib.php')) {
require_once _PS_MODULE_DIR_ . 'ph_simpleblog/assets/recaptchalib.php';
}
$secret = Configuration::get('PH_BLOG_COMMENTS_RECAPTCHA_SECRET_KEY');
$response = null;
if (!class_exists('ReCaptcha')) {
die('Sorry, you want to use reCAPTCHA but class to handle this doesn\'t exists');
}
$reCaptcha = new ReCaptcha($secret);
if (Tools::getValue('g-recaptcha-response')) {
$response = $reCaptcha->verifyResponse($_SERVER["REMOTE_ADDR"], Tools::getValue('g-recaptcha-response'));
}
if ($response == null) {
$errors[] = $this->module->l('Please provide valid reCAPTCHA value', 'single');
}
}
if (Tools::getValue('comment_content') && Validate::isGenericName(Tools::getValue('comment_content'))) {
$comment_content = Tools::getValue('comment_content');
} else {
$errors[] = $this->module->l('Please write something and remember that HTML is not allowed in comment content.', 'single');
}
$customer_name = Tools::getValue('customer_name');
if (!Validate::isGenericName($customer_name)) {
$errors[] = $this->module->l('Please provide valid name', 'single');
}
if (!Validate::isInt(Tools::getValue('id_parent'))) {
die('FATAL ERROR [2]');
} else {
$id_parent = Tools::getValue('id_parent');
}
$ip_address = Tools::getRemoteAddr();
if (sizeof($errors)) {
$this->errors = $errors;
} else {
$comment = new SimpleBlogComment();
$comment->id_simpleblog_post = (int) Tools::getValue('id_simpleblog_post');
$comment->id_parent = $id_parent;
$comment->id_customer = (int) $this->context->customer->id ? (int) $this->context->customer->id : 0;
$comment->id_guest = (int) $this->context->customer->id_guest ? (int) $this->context->customer->id_guest : 0;
$comment->name = $customer_name;
$comment->email = isset($this->context->customer->email) ? $this->context->customer->email : null;
$comment->comment = $comment_content;
$comment->active = Configuration::get('PH_BLOG_COMMENT_AUTO_APPROVAL') ? 1 : 0;
$comment->ip = Tools::getRemoteAddr();
if ($comment->add()) {
if (!Configuration::get('PH_BLOG_COMMENT_AUTO_APPROVAL')) {
$confirmation = '2';
}
$link = $this->context->link->getModuleLink('ph_simpleblog', 'single', array('confirmation' => $confirmation, 'rewrite' => $SimpleBlogPost->link_rewrite, 'sb_category' => $SimpleBlogPost->category_rewrite));
if (Configuration::get('PH_BLOG_COMMENT_NOTIFICATIONS')) {
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$fromName = strval(Configuration::get('PS_SHOP_NAME'));
$to = Configuration::get('PH_BLOG_COMMENT_NOTIFY_EMAIL');
$from = Configuration::get('PS_SHOP_EMAIL');
$customer = $this->context->customer;
if ($this->context->customer->isLogged()) {
$lastname = $this->context->customer->lastname;
$firstname = $this->context->customer->firstname;
} else {
$lastname = '';
$firstname = $customer_name;
}
Mail::Send($this->context->language->id, 'new_comment', sprintf(Mail::l('New comment on %1$s blog for article: %2$s', $this->context->language->id), $toName, $SimpleBlogPost->title), array('{lastname}' => $customer->lastname, '{firstname}' => $customer->firstname, '{post_title}' => $SimpleBlogPost->title, '{post_link}' => $SimpleBlogPost->url, '{comment_content}' => $comment_content), $to, $toName, $from, $fromName, null, null, _PS_MODULE_DIR_ . 'ph_simpleblog/mails/');
}
Tools::redirect($link);
} else {
$this->errors = $this->module->l('Something went wrong! Comment can not be added!', 'single');
}
}
}
return parent::postProcess();
}
示例15: postProcess
public function postProcess()
{
parent::postProcess();
$pagNotification = new PagSeguroNotificationOrderPrestashop();
$pagNotification->postProcess($_POST);
}