28 lines
831 B
PHP
28 lines
831 B
PHP
<?php
|
|
/**
|
|
* Description of privatesalesnewsletter
|
|
*
|
|
* @company Antadis
|
|
*/
|
|
|
|
class privatesalesalertModuleFrontController extends ModuleFrontController {
|
|
|
|
|
|
|
|
public function ajaxProcessSubmit(){
|
|
$id_privatesales = Tools::getValue('id_privatesales');
|
|
if($id_privatesales)
|
|
$this->content = Tools::jsonEncode(array('hasError' => true));
|
|
|
|
$customer = Context::getContext()->customer;
|
|
$alert = new SaleAlertMail();
|
|
$alert->id_privatesales = $id_privatesales;
|
|
$alert->id_user = $customer->id;
|
|
$alert->email = $customer->email;
|
|
if($alert->add){
|
|
$this->content = Tools::jsonEncode(array('hasError' => false));
|
|
}else{
|
|
$this->content = Tools::jsonEncode(array('hasError' => true));
|
|
}
|
|
}
|
|
} |