84 lines
3.0 KiB
PHP
84 lines
3.0 KiB
PHP
<?php
|
|
/**
|
|
* Copyright ETS Software Technology Co., Ltd
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This file is not open source! Each license that you purchased is only available for 1 website only.
|
|
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
|
|
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
|
|
*
|
|
* DISCLAIMER
|
|
*
|
|
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
|
* versions in the future.
|
|
*
|
|
* @author ETS Software Technology Co., Ltd
|
|
* @copyright ETS Software Technology Co., Ltd
|
|
* @license Valid for 1 website (or project) for each purchase of license
|
|
*/
|
|
|
|
if (!defined('_PS_VERSION_'))
|
|
exit;
|
|
class Ets_promotionAjaxModuleFrontController extends ModuleFrontController
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
public function init()
|
|
{
|
|
parent::init();
|
|
}
|
|
public function postProcess()
|
|
{
|
|
if(Tools::isSubmit('submitChangePayment'))
|
|
{
|
|
$payment = Tools::getValue('payment');
|
|
$id_payment_method = (int)Tools::getValue('id_payment_method');
|
|
if(Validate::isModuleName($payment) && ($module = Module::getInstanceByName($payment)) && $module->id)
|
|
{
|
|
Context::getContext()->cookie->ets_pr_payment= $module->id.($id_payment_method ? '-'.$id_payment_method:'');
|
|
Context::getContext()->cookie->write();
|
|
}
|
|
else
|
|
{
|
|
Context::getContext()->cookie->ets_pr_payment =0;
|
|
Context::getContext()->cookie->write();
|
|
}
|
|
die(
|
|
json_encode(
|
|
array(
|
|
'cart'=> array(),
|
|
)
|
|
)
|
|
);
|
|
}
|
|
if(Tools::isSubmit('submitEtsPrClosePopup') && ($id_promote = (int)Tools::getValue('submitEtsPrClosePopup')))
|
|
{
|
|
if($this->context->cookie->pr_closed_popups)
|
|
{
|
|
$pr_closed_popups = explode(',',$this->context->cookie->pr_closed_popups);
|
|
}
|
|
else
|
|
$pr_closed_popups = array();
|
|
$pr_closed_popups[] = $id_promote;
|
|
$this->context->cookie->pr_closed_popups = implode(',',$pr_closed_popups);
|
|
$this->context->cookie->write();
|
|
die('Closed');
|
|
}
|
|
if(Tools::isSubmit('submitEtsPrCloseHighlightBar') && ($id_promote = (int)Tools::getValue('submitEtsPrCloseHighlightBar')))
|
|
{
|
|
if($this->context->cookie->pr_closed_highlightbars)
|
|
{
|
|
$pr_closed_highlightbars = explode(',',$this->context->cookie->pr_closed_highlightbars);
|
|
}
|
|
else
|
|
$pr_closed_highlightbars = array();
|
|
$pr_closed_highlightbars[] = $id_promote;
|
|
$this->context->cookie->pr_closed_highlightbars = implode(',',$pr_closed_highlightbars);
|
|
$this->context->cookie->write();
|
|
die('Closed');
|
|
}
|
|
}
|
|
} |