VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: pm4698 on April 04, 2016, 15:21:51 PM

Title: Ask question thank you page url
Post by: pm4698 on April 04, 2016, 15:21:51 PM
Hello there,

We use joomla 3 and virtuemart 3 and we would like to know the thank you page url after someone asks for a product through ask a question form.

Thank you in advance
Title: Re: Ask question thank you page url
Post by: jenkinhill on April 04, 2016, 15:30:23 PM
http://forum.virtuemart.net/index.php?topic=128401

Assuming you are using the default VM templates the url is exactly the same as the product, because the ask question form & response are in a modal. The thankyou template is components/com_virtuemart/views/askquestion/tmpl/mail_confirmed.php
Title: Re: Ask question thank you page url
Post by: pm4698 on April 04, 2016, 15:32:01 PM
What i need is a URL in order to track the people that ask for each product. Do you have any ideas? From analytics department they asked me to give this URL in order to use it with Google analytics
Title: Re: Ask question thank you page url
Post by: pm4698 on April 04, 2016, 15:47:03 PM
One idea that just came to mind, is maybe if on submiting the ask questoin form, to open a url window with the product url and something at the end like ?thankyou and open this for example for 1 - 2 seconds and close this, to take the thank you  as analytics data. What do you think?
Title: Re: Ask question thank you page url
Post by: pm4698 on April 04, 2016, 16:00:42 PM
I am trying inside view.html.php file in askquestion folder at the path you specified to add in rendermailLayout function something like this:

$mylink = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id.'&tmpl=component', FALSE) ;
      $link = "<script>window.open('$mylink', 'width=1,height=1,left=0,top=0')</script>";

echo $link;

For sure its not working, but do you have an idea how could this work?

Thank you in advance