Jump to content
glenskie16

mail alerts not working at all ?

Recommended Posts

When you click on notify me when available it does nothing, it just sits there .... no errors no nothing ? please help thank you! I have verion 2.5 of the module and i have version 1.5.4.1 of prestashop.

Share this post


Link to post
Share on other sites

any chance to see it live? if so, please share url

Share this post


Link to post
Share on other sites

it's due to the mixed contents filtering in modern browsers:

2
XMLHttpRequest cannot load https://www.riverbendbikes.com/module/mailalerts/actions?process=add. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.riverbendbikes.com' is therefore not allowed access. 

try to use latest version of this module (3.2)

Share this post


Link to post
Share on other sites

hello

 

can you check module tpl file please? (views/templates/hook/product.tpl)

 

there is an "addNotification()" function

function  addNotification() {
	$.ajax({
		type: 'POST',
		url: "{/literal}{$link->getModuleLink('mailalerts', 'actions', ['process' => 'add'])}{literal}",
		data: 'id_product={/literal}{$id_product}{literal}&id_product_attribute='+$('#idCombination').val()+'&customer_email='+$('#oos_customer_email').val()+'',
		success: function (msg) {
			if (msg == '1') {
				$('#mailalert_link').hide();
				$('#oos_customer_email').hide();
				$('#oos_customer_email_result').html("{/literal}{l s='Request notification registered' mod='mailalerts'}{literal}");
				$('#oos_customer_email_result').css('color', 'green').show();
			}
			else if (msg == '2' ) {
				$('#oos_customer_email_result').html("{/literal}{l s='You already have an alert for this product' mod='mailalerts'}{literal}");
				$('#oos_customer_email_result').css('color', 'red').show();
			} else {
				$('#oos_customer_email_result').html("{/literal}{l s='Your e-mail address is invalid' mod='mailalerts'}{literal}");
				$('#oos_customer_email_result').css('color', 'red').show();
			}
		}
	});
	return false;
}

does it look exactly the same?

Share this post


Link to post
Share on other sites

XMLHttpRequest cannot load https://www.riverbendbikes.com/module/mailalerts/actions?process=check. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.riverbendbikes.com' is therefore not allowed access.

 

I ADDED THIS TO MAKE IT WORK !

 

header('Access-Control-Allow-Origin: *');

Edited by glenskie16 (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

XMLHttpRequest cannot load https://www.riverbendbikes.com/module/mailalerts/actions?process=check. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://www.riverbendbikes.com' is therefore not allowed access.

 

I ADDED THIS TO MAKE IT WORK !

 

header('Access-Control-Allow-Origin: *');

where add this line?

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More