VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: mwerner on February 23, 2012, 03:18:38 AM

Title: Ask a question about this product - email is missing url, product image and SKU?
Post by: mwerner on February 23, 2012, 03:18:38 AM
Hi,

I have a question regarding the email send to admin via the "Ask a question about this product" button/link.

I would like have the same function as the email form had in Virtuemart 1 (see attachment):


1. A URL link to the product.
2. A thumbnail image of product.
3. SKU number of product.


I am sure the code for the email is in /components/com_virtuemart/views/askquestion/tmpl (mail_html_question.php)

Can anyone help with some code to include these 3 functions/requests?

I am using joomla 2.5.1 virtuemart (com_virtuemart.2.0.1.N)

Thanks
Michael


[attachment cleanup by admin]
Title: Re: Ask a question about this product - email is missing url, product image and SKU?
Post by: ad_wk on March 19, 2012, 15:44:49 PM
This for me too.

Though I managed to get the SKU by adding a line
<?php echo$this->product->product_sku ?>
after the product name.

Still clueless about the other two.

Joomla! 2.5.3
VirtueMart 2.0.2
Title: Re: Ask a question about this product - email is missing url, product image and SKU?
Post by: ad_wk on March 21, 2012, 23:53:44 PM
OK, a rough workaround after a lot of trial'n'error :D:

Somewhere near this line showing your product name:
<?php echo JText::_('COM_VIRTUEMART_QUESTION_ABOUT').' '.$this->product->product_name ?>

I added these lines:

       Product SKU: <?php echo$this->product->product_sku ?>
         
       Product short description: <?php echo $this->product->product_s_desc ?>

       Link : <a href="http://www.yoursite.com/index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=<?php echo $this->product->virtuemart_product_id ?>" title="<?php echo$this->product->product_name ?>"><?php echo$this->product->product_name ?></a>
   


The title part is optional. Note of course that you should replace 'www.yoursite.com' with your actual site url.
This link opens the product in a separate window without site layout - at least in my case. SEO is turned on, could be the reason.

Also the image is not included in the email - as of yet.

Hope this helps. And also hope that someone at some point makes this more universal.
Title: Re: Ask a question about this product - email is missing url, product image and SKU?
Post by: ad_wk on May 08, 2012, 12:19:32 PM
Ok, updating this. In the code after the table row tag of the Product name you might write something like this:
<tr>
          <p>Product SKU: <?php echo$this->product->product_sku ?>
          </p>
          <p>Product short description: <?php echo $this->product->product_s_desc ?>
          </p>
          <p>Link: <a href="<?php echo juri::root()?>/index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=<?php echo $this->product->virtuemart_product_id ?>" title="<?php echo$this->product->product_name ?>"><?php echo$this->product->product_name ?></a>
          </p>                 
</tr>

It simply creates a new table row with Product SKU, Product short description and a link to the product page each in its own paragraph.

I haven't even tried to solve the 'separate product page' or missing image issues as this one fulfills my needs currently :)

So if someone more competent has provided / can provide a better solution, please post it here.

Also maybe it's just me or my settings, but this doesn't seem to work from template overrides: <path-to-siteroot\templates\mytemplate\html\com_virtuemart\askquestion\mail_html_question.php>.

Instead I've had to use it in it's original place i.e. <path-to-siteroot\components\com_virtuemart\views\askquestion\tmpl\mail_html_question.php>.

Other overrides like product and category views seem to work just fine. Some light on this, anyone?

Title: Re: Ask a question about this product - email is missing url, product image and SKU?
Post by: Murkur on May 24, 2012, 22:28:55 PM
Link to product page in Ask a question mail i did like this
<a href="<?php echo JURI::root().'virtuemart/productdetails/' $this->product->virtuemart_product_id '/' $this->product->virtuemart_category_id?>"><?php echo JText::_('COM_VIRTUEMART_QUESTION_ABOUT').' '.$this->product->product_name ?></a>
Title: Re: Ask a question about this product - email is missing url, product image and SKU?
Post by: Coolson on November 15, 2012, 03:42:48 AM
<input type="hidden" name="link" value="<?php echo $this->product->images[0]->file_url_thumb;  ?>" />    in the file: form.php (in others input hidden)

<img src="<?php echo JURI::root().JRequest::getVar('link'); ?>" /> in the file: mail_html_question.php

its all