VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: dsrpmedia on July 23, 2014, 19:27:02 PM

Title: send 'ask a question' email to a different address than 'product order' email
Post by: dsrpmedia on July 23, 2014, 19:27:02 PM
Hi,

I need to have the  'ask a question' email sent to to a different address than 'product order' email, as it is 2 different people who need to recieve them (sales support for ask a question & the shipper for product order notification)

how would I do this?

thank you!!!!
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: dsrpmedia on July 23, 2014, 20:11:57 PM
I figured out a way to do this with an override of the productdetails default.php - replace the existing ask a question code with

<a class="ask-a-question" href="mailto:myemail@mysite.com?subject=Question re <?php echo $this->product->product_name ?> ">Ask a question about this product</a>

works!!!
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: Milbo on July 28, 2014, 20:50:02 PM
nice :-)
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: Vlada vanek on January 06, 2016, 10:26:50 AM
better variant is to set filter in your email box, redirect for emails with subject Ask, question...
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: batboiko on November 17, 2016, 19:18:39 PM
Can someone give me solution for Virtuemrt 3

This is the code i have:

// Ask a question about this product
if (VmConfig::get('ask_question', 0) == 1) {
$askquestion_url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component', FALSE);
?>
<div class="ask-a-question">
<a class="ask-a-question" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL'?></a>
</div>
<?php
}
?>


<?php


So where to put the email?
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: GJC Web Design on November 18, 2016, 11:34:52 AM
the snippet above just uses a std. mailto link to open your mail client

it won't work if u want to use the modal form etc

to do what u want will need a core hack in the helper or a plugin
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: batboiko on November 18, 2016, 17:48:23 PM
Thank you for your reply. Is it under com_virtuemrt - Helpers - vmview.php or is something else?
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: GJC Web Design on November 18, 2016, 22:46:41 PM
well .. vm mail is sent from   components\com_virtuemart\helpers\shopfunctionsf.php  --

but mail is built in components\com_virtuemart\views\askquestion\view.html.php

so prob there
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: Studio 42 on November 20, 2016, 23:07:44 PM
If you only need a value or two(sku+name for eg) , i think you can link to an external form builder and add the value(s) in the link.
This permit to add some security check and not reveal directly your email to all spammers & hackers as explained by dsrpmedia.
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: batboiko on November 21, 2016, 19:00:46 PM
Quote from: Studio 42 on November 20, 2016, 23:07:44 PM
If you only need a value or two(sku+name for eg) , i think you can link to an external form builder and add the value(s) in the link.
This permit to add some security check and not reveal directly your email to all spammers & hackers as explained by dsrpmedia.

I don't want dsrpmedia solution. I want to use Virtuemart "ask question about this product" form but when someone hit the "send" button the email to be send to different email (not the shop vendor email)
Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: GJC Web Design on November 21, 2016, 19:13:52 PM
Stu 42 isn't saying to use it

he suggests using a different form comp

I used breezingforms here  ->  https://www.palmerstownpharmacy.ie/en/health/pain-management/paralief-paracetamol-500mg-24

click the Complete form button .. it is like Ask a question.. but it opens a form which you can do what u want with and send where u like

the details of the product etc are just passed by hidden fields and js -- but there are different ways to do it

or if u just want a different email then hack  components\com_virtuemart\views\askquestion\view.html.php  as I suggested

Title: Re: send 'ask a question' email to a different address than 'product order' email
Post by: Studio 42 on November 21, 2016, 19:47:28 PM
I give you a clean way to do this.

If you prefer hack the VM core and on each update redo the same changes , then use GJC Web Design solution and add manually the code to change the vendor mail.

I only give long term solution, if i can.