News:

Support the VirtueMart project and become a member

Main Menu

Recommend email

Started by major, November 22, 2012, 17:58:48 PM

Previous topic - Next topic

major

Joomla 2.5 | virtuemart 2.014

The email works finne but when i receby the email as a recommendation from a user the image do not show and theres no links back to the product.

If it is a recommendation it should have a link back to the product for a direct access.

Anyone that wont's to help can test in the link below and send a email recommendation to it self and see the email
http://www.mobiliariocomluz.pt/mobiliario-de-interior/cadeiras-interior/barbarella_details


And this is the code from virtuemart to the email that is send, maybe something is missing in the image code
<?php

defined
('_JEXEC') or die('');

/**

* Renders the email for recommend to a friend

* @package VirtueMart

* @subpackage product details

* @author ValĂ©rie Isaksen

* @link http://www.virtuemart.net

 * @copyright Copyright (c) 2004 - 2012 VirtueMart Team. All rights reserved.

 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php

 * VirtueMart is free software. This version may have been modified pursuant

* to the GNU General Public License, and as distributed it includes or

 * is derivative of works licensed under the GNU General Public License or

 * other free or open source software licenses.

 * @version $Id$

 */

?>




<html>

<head>

<style type="text/css">

body, td, span, p, th { font-size: 11px; }

table.html-email {margin:10px auto;background:#fff;border:solid #dad8d8 1px;}

.html-email tr{border-bottom : 1px solid #eee;}

span.grey {color:#666;}

span.date {color:#666;font-size: 10px;}

a.default:link, a.default:hover, a.default:visited {color:#666;line-height:25px;background: #f2f2f2;margin: 10px ;padding: 3px 8px 1px 8px;border: solid #CAC9C9 1px;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;text-shadow: 1px 1px 1px #f2f2f2;font-size: 12px;background-position: 0px 0px;display: inline-block;text-decoration: none;}

a.default:hover {color:#888;background: #f8f8f8;}

.cart-summary{ }

.html-email th { background: #ccc;margin: 0px;padding: 10px;}

.sectiontableentry2, .html-email th, .cart-summary th{ background: #ccc;margin: 0px;padding: 10px;}

.sectiontableentry1, .html-email td, .cart-summary td {background: #fff;margin: 0px;padding: 10px;}

</style>



</head>



<body style="background: #F2F2F2;word-wrap: break-word;">

<div style="background-color: #e6e6e6;" width="100%">

<table style="margin: auto;" cellpadding="0" cellspacing="0" width="600" ><tr><td>



<table width="600" border="0" cellpadding="0" cellspacing="0" class="html-email">

<tr>

<td valign="top">

<img src="<?php  echo JURI::root () . $this->vendor->images[0]->file_url ?>" />

</td>

<td>

<?php echo $this->vendorAddress?>

</td>

</tr>

<tr>

<td colspan="2">

<strong><?php echo JText::sprintf ('COM_VIRTUEMART_MAIL_SHOPPER_NAME'$this->user['email']); ?></strong><br/>

</td>

</tr>

</table>



<table style="margin: auto;" cellpadding="0" cellspacing="0" width="600" >

<tr>

<td>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="html-email">

<tr>

<td >

<?php echo JText::sprintf('COM_VIRTUEMART_RECOMMEND_MAIL_MSG'$this->product->product_name,   $this->comment); ?>

</td>

</tr>

</table>

</td>

</tr>

</table>

<?php



$link JURI::root().'index.php?option=com_virtuemart';



echo '<br/><br/>';



/* GENERAL FOOTER FOR ALL MAILS */

echo JText::_('COM_VIRTUEMART_MAIL_FOOTER' ) . '<a href="'.$link.'">'.$this->vendor->vendor_name.'</a>';

echo '<br/>';

echo $this->vendor->vendor_name .'<br />'.$this->vendor->vendor_phone .' '.$this->vendor->vendor_store_name .'<br /> '.$this->vendor->vendor_store_desc.'<br />'.$this->vendor->vendor_legal_info;

?>


</td></tr>

</table>

</div>

</body>

</html>


chetanmadaan

You can add the following code just below link 58
<br><br><a href="<?php echo $this->product->link ;?>"><?php echo $this->product->product_name?></a>
The new code would look something like this.
<?php echo JText::sprintf('COM_VIRTUEMART_RECOMMEND_MAIL_MSG'$this->product->product_name,   $this->comment); ?>
<br><br><a href="<?php echo $this->product->link ;?>"><?php echo $this->product->product_name?></a>


This will get the product name right after the message and then the product link too.

Thanks

major

Its working but have to change the code

<br><br><a href="http://www.your-site-name<?php echo $this->product->link ;?>"><?php echo $this->product->product_name; ?></a>

Any idea how to get the image to show in the email???

Thanks

[attachment cleanup by admin]

mfgrmn

Quote from: chetanmadaan on November 22, 2012, 19:26:00 PM
You can add the following code just below link 58
<br><br><a href="<?php echo $this->product->link ;?>"><?php echo $this->product->product_name?></a>
The new code would look something like this.
<?php echo JText::sprintf('COM_VIRTUEMART_RECOMMEND_MAIL_MSG'$this->product->product_name,   $this->comment); ?>
<br><br><a href="<?php echo $this->product->link ;?>"><?php echo $this->product->product_name?></a>


This will get the product name right after the message and then the product link too.

Thanks

Hi!
Thanks! your script did work in getting the product name as a link, but the link has no url to take you to so the link is empty. So whats missing in your code? And also, how do we include the product picture and perhaps description? But picture most of all? Thanks!

mfgrmn

Nevermind. Solved it! Use this code instead! Also includes Sku# and Product description.

<br><br>
          <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?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>

mfgrmn

Would be nice to include the product picture. Anyone know how to add it?