Jump to content

Email product to a friend send button not working.


Recommended Posts

Hello PS folks,

I'm run v1.5.4.1 and when I open the popup window for sending a email to a friend, when I click on te send button, there happend nothing, no sending the email. No error displaying.

 

I have reïnstall and activate the module, but nothing change.

I have see that the popup window layout pointes to the Paypal css in chrome dev tools!!

www.erotiekfabriek.be

 

Anybody a solution for these prob?

 

Thanks in advance,

Generaal

Edited by Generaal (see edit history)
Link to comment
Share on other sites

Hello Nemo1,

I have search for this issue:

In firebug I have see the follow things, when I click on the send email button:

HeadersPostResponse

 

Notice: Undefined property: stdClass::$value in /home/admin/domains/erotiekfabriek.be/public_html/modules/sendtoafriend/sendtoafriend_ajax.php on line 43

 

Notice: Undefined property: stdClass::$value in /home/admin/domains/erotiekfabriek.be/public_html/modules/sendtoafriend/sendtoafriend_ajax.php on line 45

0

 

200 OK 254ms

HeadersPostResponse

 

Parametersapplication/x-www-form-urlencoded action sendToMyFriend friend [{"key":"friend_name","val":"Roger"},{"key":"friend_email","val":"[email protected]"},{"key":"id_prodt","val":"476"},{"key":"sendEmail","val":"Verzenden"}] secure_key ff2e04e600f64f39f9047ffd3fdac57c

Source action=sendToMyFriend&secure_key=ff2e04e600f64f39f9047ffd3fdac57c&friend=%5B%7B%22key%22%3A%22friend_name%22%2C%22val%25ue%22%3A%22Roger%22%7D%2C%7B%22key%22%3A%22friend_email%22%2C%22val%25ue%22%3A%22bbc.bvba%40gmail.com%22%7D%2C%7B%22key%22%3A%22id_prod%25uct%22%2C%22val%25ue%22%3A%22476%22%7D%2C%7B%22key%22%3A%22sendEmail%22%2C%22val%25ue%22%3A%22Verzenden%22%7D%5D

POST /modules/sendtoafriend/sendtoafriend_ajax.php

200 OK 15465ms

 

 

below the sendtoafriend ajax file:

 

<?php

/*

* 2007-2013 PrestaShop

*

* NOTICE OF LICENSE

*

* This source file is subject to the Academic Free License (AFL 3.0)

* that is bundled with this package in the file LICENSE.txt.

* It is also available through the world-wide-web at this URL:

* http://opensource.org/licenses/afl-3.0.php

* If you did not receive a copy of the license and are unable to

* obtain it through the world-wide-web, please send an email

* to [email protected] so we can send you a copy immediately.

*

* DISCLAIMER

*

* Do not edit or add to this file if you wish to upgrade PrestaShop to newer

* versions in the future. If you wish to customize PrestaShop for your

* needs please refer to http://www.prestashop.com for more information.

*

* @author PrestaShop SA <[email protected]>

* @copyright 2007-2013 PrestaShop SA

* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)

* International Registered Trademark & Property of PrestaShop SA

*/

 

require_once(dirname(__FILE__).'/../../config/config.inc.php');

require_once(dirname(__FILE__).'/../../init.php');

include_once(dirname(__FILE__).'/sendtoafriend.php');

include_once(dirname(__FILE__).'/../../classes/Product.php');

 

$module = new SendToAFriend();

 

if (Tools::getValue('action') == 'sendToMyFriend' && Tools::getValue('secure_key') == $module->secure_key)

{

$friend_infos = Tools::jsonDecode(Tools::getValue('friend'));

$friendName = "";

$friendMail = "";

$id_product = null;

foreach ($friend_infos as $entry)

{

if ($entry->key == "friend_name")

$friendName = $entry->value;

else if ($entry->key == "friend_email")

$friendMail = $entry->value;

else if ($entry->key == "id_product")

$id_product = $entry->value;

}

if (!$friendName || !$friendMail || !$id_product)

die('0');

 

/* Email generation */

$product = new Product((int)$id_product, false, $module->context->language->id);

$productLink = $module->context->link->getProductLink($product);

$customer = $module->context->cookie->customer_firstname ? $module->context->cookie->customer_firstname.' '.$module->context->cookie->customer_lastname : $module->l('A friend', 'sendtoafriend_ajax');

 

$templateVars = array(

'{product}' => $product->name,

'{product_link}' => $productLink,

'{customer}' => $customer,

'{name}' => Tools::safeOutput($friendName)

);

 

/* Email sending */

if (!Mail::Send((int)$module->context->cookie->id_lang,

'send_to_a_friend',

sprintf(Mail::l('%1$s sent you a link to %2$s', (int)$module->context->cookie->id_lang), $customer, $product->name),

$templateVars, $friendMail,

null,

($module->context->cookie->email ? $module->context->cookie->email : null),

($module->context->cookie->customer_firstname ? $module->context->cookie->customer_firstname.' '.$module->context->cookie->customer_lastname : null),

null,

null,

dirname(__FILE__).'/mails/'))

die('0');

die('1');

}

die('0');

 

I have these file replaced by the original PS file, but nothing change.

 

Best Regards,

Generaal

Link to comment
Share on other sites

  • 3 months later...
×
×
  • Create New...