News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

recommend form: How to Add an additional email recipient

Started by conejo, March 10, 2014, 14:54:59 PM

Previous topic - Next topic

conejo

Hello together!
I´m working with Joomla! 2.5.11 / VM2.0.24c
on file ..//mytemplate/html/com_virtuemart/recommend/form.php

I want to add a custom field like in topic  "How to add Custom Fields to "Ask A Question../Call for Price" ??"
but in my case must be an additional email recipient.
This field must be optional. It is for example to send to my self or any body else a copy of the recommendation.

Many thanks for a replay,
Alejandro


conejo

its me again:

I found out that the "recommend" email will be send in components/com_virtuemart/controllers/productdetails.php controller:
I thing that the solution is to override the file and send a second mail after following code:
Line 199:
      $toMail = JRequest::getVar ('email'); //is sanitized then
      $toMail = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $toMail);

      if (shopFunctionsF::renderMail ('recommend', $toMail, $vars, 'productdetails', TRUE)) {
         $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
      } else {
         $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
      }

For example adding following code...
        $tocopymail = JRequest::getVar ('tocopymail'); //is sanitized then
   $tocopymail = str_replace (array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $tocopymail);
   shopFunctionsF::renderMail ('recommend', $tocopymail, $vars, 'productdetails', TRUE)

My problem is that I can´t override the controller and I´m not sure if this is the correct solution of this problem:
I tried following:
//My-template/html/com_virtuemart/controllers/productdetails.php
//My-template/code/com_virtuemart/controllers/productdetails.php
And some others but there change nothing.

Many thanks in advance for any help,

Alejandro

Note:
See the example in my page in http://cristinaloewy.de/werke/aktuelle-werke/415/fields-of-joy-detail
"Als E-Postkarte schicken" -> "Kopie an mein E-Mail (optional):" .

Thanks and regards

Alejandro


QuoteI need to do this before I update to the newest version!
Please help me!!

Thanks in advance,

Alejandro