domino

domino

opencart 2.3.0.2中使用domino模板时newsletter无响应的问题及修复

技术问答neasel 发表了文章 • 0 个评论 • 25 次浏览 • 2017-05-02 22:29 • 来自相关话题

此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP 修改位于catalog/controller/extension/module/newslettersubscribe.php<?php cla ...查看全部
此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP
修改位于catalog/controller/extension/module/newslettersubscribe.php
<?php  
class ControllerExtensionModuleNewslettersubscribe extends Controller {
private $error = array();

public function index($setting) {

$this->language->load('extension/module/newslettersubscribe');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.bpopup.min.js');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.cookie.js');

$data['heading_title'] = $this->language->get('heading_title');
$data['newletter_lable'] = $this->language->get('newletter_lable');
$data['sub_newletter'] = $this->language->get('sub_newletter');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $setting['newslettersubscribe_thickbox'];
$data['entry_show_again'] = $this->language->get('entry_show_again');
$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';
if(isset($setting['popup']) && $setting['popup']==1) {
return $this->load->view('extension/module/newsletterpopup', $data);
}else {
return $this->load->view('extension/module/newslettersubscribe', $data);
}


$this->load->model('account/newslettersubscribe');
//check db
$this->model_account_newslettersubscribe->check_db();
}

public function subscribe() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_email'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_name'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_email'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_name'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function subscribepopup() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_pemail']) and filter_var($this->request->post['subscribe_pemail'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_pemail'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_pname'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_pemail'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_pname'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function unsubscribe(){

if ($this->config->get('newslettersubscribe_thickbox')) {
$prefix_eval = "";
} else {
$prefix_eval = "";
}

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {

if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,0);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('notexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

} else {

if ($this->config->get('option_unsubscribe')) {

$this->model_account_newslettersubscribe->unsubscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

protected function loadmodule() {

$this->language->load('extension/module/newslettersubscribe');

$data['heading_title'] = $this->language->get('heading_title');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $this->config->get('newslettersubscribe_thickbox');

$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';


return $this->load->view('extension/module/newslettersubscribe.tpl', $data);
}
}
?>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newsletterpopup.tpl
<div class="newletter-container">
<div id="boxes" class="newletter-container newsletter-popup">
<div style="" id="dialog" class="window ">
<div class="box ">
<!-- <div class="png-popup1" style="height:auto;width: 100%;">
<img src="image/catalog/demo/newsletter-1.jpg" alt="#">
</div> -->
<div id="popup2" class="btn-close-form">
<span class="button b-close"><span>X</span></span>
<div class="content"></div>
</div>
<div class="newletter-title"><h2><?php echo $heading_title; ?></h2></div>
<div class="box-content newleter-content">
<label><?php echo $newletter_lable; ?></label>
<div id="frm_subscribes">
<form name="subscribe" id="subscribe_popup">
<div>
<!-- <span class="required">*</span><span><?php //echo $entry_email; ?></span> -->
<input type="text" value="" name="subscribe_pemail" id="subscribe_pemail">
<input type="hidden" value="" name="subscribe_pname" id="subscribe_pname" />
</div>
<div class="subs-links text-center">
<a class="button" onclick="email_subscribepopup()"><span><?php echo $entry_button; ?></span></a>
</div>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribepopup()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
<div class="subscribe-bottom">
<input type="checkbox" id="newsletter_popup_dont_show_again">
<label for="newsletter_popup_dont_show_again"><?php echo $entry_show_again; ?></label>
</div>
</div><!-- /#frm_subscribe -->
<div id="notification"></div>
</div><!-- /.box-content -->
<!-- <div class="png-popup2" style="height:120px;width: 150px;">
<img src="image/catalog/demo/newletter_item.png" alt="#">
</div> -->
</div>
</div>

<script type="text/javascript">
function email_subscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribepopup',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
$.cookie('shownewsletter', '1');
eval(html);
}});


}
function email_unsubscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {

if($.cookie('shownewsletter')==1) $('#boxes').hide();
$('#subscribe_pemail').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribepopup();
}
var name= $(this).val();
$('#subscribe_pname').val(name);
});
$('#subscribe_pemail').change(function() {
var name= $(this).val();
$('#subscribe_pname').val(name);
});


//transition effect
if($.cookie("shownewsletter") != 1){
$('#boxes').bPopup();

}

//if close button is clicked
$('.b-modal').click(function (e) {
$.cookie('shownewsletter', '1');
});

$('#newsletter_popup_dont_show_again').on('change', function(){
if($.cookie("shownewsletter") != 1){
$.cookie("shownewsletter",'1')
}else{
$.cookie("shownewsletter",'0')
}
});


});

</script>


</div><!-- /.box -->
</div>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newslettersubscribe.tpl
<div class="newletter-subscribe">
<div class="containers">
<div id="box" class="newletter-container">
<div style="" id="dialog_nomal" class="window">
<div class="box">
<div class="newletter-title">
<h2><?php echo $newletter_lable; ?></h2>
<!-- <span class="sub-newletter"><?php echo $sub_newletter; ?></span> -->
</div>
<div class="box-content newleter-content">
<label class="hidden"><?php echo $newletter_lable; ?></label>
<div id="frm_subscribe">
<form name="subscribe" id="subscribe">
<input type="text" value="" name="subscribe_email" id="subscribe_email">
<input type="hidden" value="" name="subscribe_name" id="subscribe_name" />
<a class="button" onclick="email_subscribe()"><span><?php echo $entry_button; ?></span></a>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribe()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
</div><!-- /#frm_subscribe -->
<div id="notification_normal"></div>
</div><!-- /.box-content -->
</div>
</div>

<script type="text/javascript">
function email_subscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});


}
function email_unsubscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#subscribe_email').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribe();
}
var name= $(this).val();
$('#subscribe_name').val(name);
});
$('#subscribe_email').change(function() {
var name= $(this).val();
$('#subscribe_name').val(name);
});

});
</script>


</div><!-- /.box -->
</div>
</div>

opencart 2.3.0.2中使用domino模板时newsletter无响应的问题及修复

技术问答neasel 发表了文章 • 0 个评论 • 25 次浏览 • 2017-05-02 22:29 • 来自相关话题

此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP 修改位于catalog/controller/extension/module/newslettersubscribe.php<?php cla ...查看全部
此补丁包此是修复此模板中的NEWSLETTER问题,及NEWSLETTERPOP
修改位于catalog/controller/extension/module/newslettersubscribe.php
<?php  
class ControllerExtensionModuleNewslettersubscribe extends Controller {
private $error = array();

public function index($setting) {

$this->language->load('extension/module/newslettersubscribe');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.bpopup.min.js');
$this->document->addScript('catalog/view/javascript/opentheme/jquery.cookie.js');

$data['heading_title'] = $this->language->get('heading_title');
$data['newletter_lable'] = $this->language->get('newletter_lable');
$data['sub_newletter'] = $this->language->get('sub_newletter');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $setting['newslettersubscribe_thickbox'];
$data['entry_show_again'] = $this->language->get('entry_show_again');
$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';
if(isset($setting['popup']) && $setting['popup']==1) {
return $this->load->view('extension/module/newsletterpopup', $data);
}else {
return $this->load->view('extension/module/newslettersubscribe', $data);
}


$this->load->model('account/newslettersubscribe');
//check db
$this->model_account_newslettersubscribe->check_db();
}

public function subscribe() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_email'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_name'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_email'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_name'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification_normal").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function subscribepopup() {

$prefix_eval = "";

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_pemail']) and filter_var($this->request->post['subscribe_pemail'],FILTER_VALIDATE_EMAIL)) {
$this->request->post['subscribe_email'] = $this->request->post['subscribe_pemail'];
$this->request->post['subscribe_name'] = $this->request->post['subscribe_pname'];


if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,1);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

$this->model_account_newslettersubscribe->subscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('subscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

if ($this->config->get('newslettersubscribe_mail_status')) {

$subject = $this->language->get('mail_subject');

$message = '<table width="60%" cellpadding="2" cellspacing="1" border="0">
<tr>
<td> Email Id </td>
<td> '.$this->request->post['subscribe_pemail'].' </td>
</tr>
<tr>
<td> Name </td>
<td> '.$this->request->post['subscribe_pname'].' </td>
</tr>';
$message .= '</table>';

$mail = new Mail();
$mail->protocol = $this->config->get('config_mail_protocol');
$mail->parameter = $this->config->get('config_mail_parameter');
$mail->hostname = $this->config->get('config_smtp_host');
$mail->username = $this->config->get('config_smtp_username');
$mail->password = $this->config->get('config_smtp_password');
$mail->port = $this->config->get('config_smtp_port');
$mail->timeout = $this->config->get('config_smtp_timeout');
$mail->setTo($this->config->get('config_email'));
$mail->setFrom($this->config->get('config_email'));
$mail->setSender($this->config->get('config_name'));
$mail->setSubject($subject);
$mail->setHtml($message);
$mail->send();
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('alreadyexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

public function unsubscribe(){

if ($this->config->get('newslettersubscribe_thickbox')) {
$prefix_eval = "";
} else {
$prefix_eval = "";
}

$this->language->load('extension/module/newslettersubscribe');

$this->load->model('account/newslettersubscribe');

if (isset($this->request->post['subscribe_email']) and filter_var($this->request->post['subscribe_email'],FILTER_VALIDATE_EMAIL)) {

if ($this->config->get('newslettersubscribe_registered') and $this->model_account_newslettersubscribe->checkRegisteredUser($this->request->post)) {

$this->model_account_newslettersubscribe->UpdateRegisterUsers($this->request->post,0);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');


} else if (!$this->model_account_newslettersubscribe->checkmailid($this->request->post)) {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('notexist').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

} else {

if ($this->config->get('option_unsubscribe')) {

$this->model_account_newslettersubscribe->unsubscribe($this->request->post);

echo('$("'.$prefix_eval.' #notification").html("<div class=\"success\"> '.$this->language->get('unsubscribe').'</div>");$("'.$prefix_eval.' #subscribe")[0].reset();');

}
}

} else {

echo('$("'.$prefix_eval.' #notification").html("<div class=\"warning\"> '.$this->language->get('error_invalid').'</div>")');

}

}

protected function loadmodule() {

$this->language->load('extension/module/newslettersubscribe');

$data['heading_title'] = $this->language->get('heading_title');

$data['entry_name'] = $this->language->get('entry_name');
$data['entry_email'] = $this->language->get('entry_email');
$data['entry_button'] = $this->language->get('entry_button');
$data['entry_unbutton'] = $this->language->get('entry_unbutton');
$data['option_unsubscribe'] = $this->config->get('option_unsubscribe');
$data['thickbox'] = $this->config->get('newslettersubscribe_thickbox');

$data['text_subscribe'] = $this->language->get('text_subscribe');

$this->id = 'newslettersubscribe';


return $this->load->view('extension/module/newslettersubscribe.tpl', $data);
}
}
?>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newsletterpopup.tpl
<div class="newletter-container">
<div id="boxes" class="newletter-container newsletter-popup">
<div style="" id="dialog" class="window ">
<div class="box ">
<!-- <div class="png-popup1" style="height:auto;width: 100%;">
<img src="image/catalog/demo/newsletter-1.jpg" alt="#">
</div> -->
<div id="popup2" class="btn-close-form">
<span class="button b-close"><span>X</span></span>
<div class="content"></div>
</div>
<div class="newletter-title"><h2><?php echo $heading_title; ?></h2></div>
<div class="box-content newleter-content">
<label><?php echo $newletter_lable; ?></label>
<div id="frm_subscribes">
<form name="subscribe" id="subscribe_popup">
<div>
<!-- <span class="required">*</span><span><?php //echo $entry_email; ?></span> -->
<input type="text" value="" name="subscribe_pemail" id="subscribe_pemail">
<input type="hidden" value="" name="subscribe_pname" id="subscribe_pname" />
</div>
<div class="subs-links text-center">
<a class="button" onclick="email_subscribepopup()"><span><?php echo $entry_button; ?></span></a>
</div>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribepopup()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
<div class="subscribe-bottom">
<input type="checkbox" id="newsletter_popup_dont_show_again">
<label for="newsletter_popup_dont_show_again"><?php echo $entry_show_again; ?></label>
</div>
</div><!-- /#frm_subscribe -->
<div id="notification"></div>
</div><!-- /.box-content -->
<!-- <div class="png-popup2" style="height:120px;width: 150px;">
<img src="image/catalog/demo/newletter_item.png" alt="#">
</div> -->
</div>
</div>

<script type="text/javascript">
function email_subscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribepopup',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
$.cookie('shownewsletter', '1');
eval(html);
}});


}
function email_unsubscribepopup(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe_popup").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {

if($.cookie('shownewsletter')==1) $('#boxes').hide();
$('#subscribe_pemail').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribepopup();
}
var name= $(this).val();
$('#subscribe_pname').val(name);
});
$('#subscribe_pemail').change(function() {
var name= $(this).val();
$('#subscribe_pname').val(name);
});


//transition effect
if($.cookie("shownewsletter") != 1){
$('#boxes').bPopup();

}

//if close button is clicked
$('.b-modal').click(function (e) {
$.cookie('shownewsletter', '1');
});

$('#newsletter_popup_dont_show_again').on('change', function(){
if($.cookie("shownewsletter") != 1){
$.cookie("shownewsletter",'1')
}else{
$.cookie("shownewsletter",'0')
}
});


});

</script>


</div><!-- /.box -->
</div>
修改文件 catalog/view/theme/您所使用的模板/template/extension/module/newsletterpopup/newslettersubscribe.tpl
<div class="newletter-subscribe">
<div class="containers">
<div id="box" class="newletter-container">
<div style="" id="dialog_nomal" class="window">
<div class="box">
<div class="newletter-title">
<h2><?php echo $newletter_lable; ?></h2>
<!-- <span class="sub-newletter"><?php echo $sub_newletter; ?></span> -->
</div>
<div class="box-content newleter-content">
<label class="hidden"><?php echo $newletter_lable; ?></label>
<div id="frm_subscribe">
<form name="subscribe" id="subscribe">
<input type="text" value="" name="subscribe_email" id="subscribe_email">
<input type="hidden" value="" name="subscribe_name" id="subscribe_name" />
<a class="button" onclick="email_subscribe()"><span><?php echo $entry_button; ?></span></a>
<?php if($option_unsubscribe) { ?>
<a class="button" onclick="email_unsubscribe()"><span><?php echo $entry_unbutton; ?></span></a>
<?php } ?>
</form>
</div><!-- /#frm_subscribe -->
<div id="notification_normal"></div>
</div><!-- /.box-content -->
</div>
</div>

<script type="text/javascript">
function email_subscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/subscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});


}
function email_unsubscribe(){
$.ajax({
type: 'post',
url: 'index.php?route=extension/module/newslettersubscribe/unsubscribe',
dataType: 'html',
data:$("#subscribe").serialize(),
success: function (html) {
eval(html);
}});
$('html, body').delay( 1500 ).animate({ scrollTop: 0 }, 'slow');

}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#subscribe_email').keypress(function(e) {
if(e.which == 13) {
e.preventDefault();
email_subscribe();
}
var name= $(this).val();
$('#subscribe_name').val(name);
});
$('#subscribe_email').change(function() {
var name= $(this).val();
$('#subscribe_name').val(name);
});

});
</script>


</div><!-- /.box -->
</div>
</div>