Serveur preprod f0c0c48223 first push
2016-04-14 16:14:31 +02:00

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));
}
}
}