- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
PrestaShop 1.5.x Troubleshooter. Send to a friend module is not working
July 8, 2015
This tutorial will show you how to fix the Send to a Friend module in Prestashop 1.5.x.
PrestaShop 1.5.x. Troubleshooter. Send to a friend module is not working
In order to get rid of the error, you will need to update theme files on server.
-
Connect to server via FTP or open cPanel file manager.
-
Open the modules/sendtoafriend folder on server. Next, open the sendtoafriend-extra.tpl file. Find the line with the $(‘#sendEmail’).click(function() function. Copy body of the function:
$('#sendEmail').click(function(){ var name = $('#friend_name').val(); var email = $('#friend_email').val(); var id_product = $('#id_product_comment_send').val(); if (name && email && !isNaN(id_product)) $.ajax({ {/literal}url: "{$module_dir}sendtoafriend_ajax.php",{literal} type: "POST", headers: {"cache-control": "no-cache"}, data: {action: 'sendToMyFriend', secure_key: '{/literal}{$stf_secure_key}{literal}', name: name, email: email, id_product: id_product},{/literal}{literal} dataType: "json", success: function(result) { $.fancybox.close(); var msg = result ? "{/literal}{l s='Your e-mail has been sent successfully' mod='sendtoafriend'}{literal}" : "{/literal}{l s='Your e-mail could not be sent. Please check the e-mail address and try again.' mod='sendtoafriend'}{literal}"; var title = "{/literal}{l s='Send to a friend' mod='sendtoafriend'}{literal}"; fancyMsgBox(msg, title); } }); }else $('#send_friend_form_error').text("{/literal}{l s='You did not fill required fields' mod='sendtoafriend' js=1}{literal}"); });
-
Next, open the themes/themeXXX/modules/sendtoafriend folder on server. Open the sendtoafriend-extra.tpl file. Find the line with the $(‘#sendEmail’).click(function() function. Replace body of the function with the code you’ve copied.
-
Save changes in the file. Refresh front-end with Ctrl/Cmd+F5 to test the form:
Feel free to check the detailed video tutorial below:
PrestaShop 1.5.x. Troubleshooter. Send to a friend module is not working