VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: malik0206 on December 19, 2014, 22:57:38 PM

Title: VM3 Recommend a Friend styling issue
Post by: malik0206 on December 19, 2014, 22:57:38 PM
Hi Guys

Please advise, on my website i have the recommend a friend icon which i like to replace with text 'Recommend This' and the text is a hyper link to lightbox

How can i remove the email icon and replace with text i have looked everywhere in the view folders but can't find where this icon is coming from so i can put text instead

Please point me to the file

Thanks
Title: Re: VM3 Recommend a Friend styling issue
Post by: jenkinhill on December 19, 2014, 23:39:06 PM
The file to override is components/com_virtuemart/views/productdetails/tmpl/default.php
Title: Re: VM3 Recommend a Friend styling issue
Post by: malik0206 on December 23, 2014, 16:16:35 PM
Hi

Thanks for the reply i have seen the code and it made no sense

This is the code your referring to

    <?php
    // PDF - Print - Email Icon
    if (VmConfig::get('show_emailfriend')) {
   ?>
        <div class="icons">
       <?php

       $link = 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->virtuemart_product_id;

      $MailLink = 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component';
       echo $this->linkIcon($MailLink, 'Recommend to a friend', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');
       ?>


Where is the link to email icon image so i can replace this with a text field

Thanks

Title: Re: VM3 Recommend a Friend styling issue
Post by: jenkinhill on December 23, 2014, 17:41:21 PM
Not best programming, but this works:

Original line of interest for components/com_virtuemart/views/productdetails/tmpl/default.php in VM3.0.2 is:

echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', ' ', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

Make a langage override for COM_VIRTUEMART_EMAIL eg to "Recommend This"

And use the edited file as a template override.
Title: Re: VM3 Recommend a Friend styling issue
Post by: malik0206 on January 04, 2015, 19:53:08 PM
Tried the code and it doesn't remove the email icon also no link text is shown

       <?php

       $link = 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->virtuemart_product_id;

      $MailLink = 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component';
      
     //  echo $this->linkIcon($MailLink, 'Recommend to a friend', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');
      
      
      echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', ' ', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');

       ?>