Facebook Like button in VirtueMart?

Feel free to talk about everything related to our Joomla Products
Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Sat Jan 14, 2012 10:26 am
Hi,

I'm trying to figure out how to add the Facebook Like button into my VirtueMart 2.0 product pages. I'm using MyFolio template on Joomla 1.7

I added this code into my VM template product override file where I want my social icons to display:

Code: Select all
$cur_url = (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];

<gavern:social><div id="gkSocialAPI"></gavern:social>
          <gavern:social><fb:like href="<?php echo $cur_url; ?>" GK_FB_LIKE_SETTINGS></fb:like></gavern:social>
       
        <gavern:social><g:plusone GK_GOOGLE_PLUS_SETTINGS callback="<?php echo $cur_url; ?>"></g:plusone></gavern:social>
          <gavern:social><a href="http://twitter.com/share" class="twitter-share-button" data-text="<?php echo $this->item->title; ?>" data-url="<?php $cur_url; ?>" GK_TWEET_BTN_SETTINGS>Tweet</a></gavern:social>
          <gavern:social><a class="DiggThisButton GK_DIGG_SETTINGS" href="<?php echo $cur_url; ?>"></a></gavern:social>
          <gavern:social><a href="http://www.delicious.com/save" onclick="window.open('http://www.delicious.com/save?v=5&noui&amp;jump=close&amp;url='+encodeURIComponent(location.href)+'&amp;title='+encodeURIComponent(document.title), 'delicious','toolbar=no,width=550,height=550'); return false;" class="deliciousBtn" title="<?php echo JText::_('TPL_GK_LANG_DELICIOUS_TITLE'); ?>"></a></gavern:social>
          <gavern:social><a href="http://www.instapaper.com/hello2?url=<?php echo urlencode($cur_url); ?>&amp;title=<?php echo urlencode($this->item->title); ?>" class="instapaperBtn" title="<?php echo JText::_('TPL_GK_LANG_INSTAPAPER_TITLE'); ?>"></a></gavern:social>
     <gavern:social><div class="clr"></div></div></gavern:social>


I can see the icons, but when I try it, I get an "error" message, and nothing appears on my Facebook profile.

I tried also with this code, to generate a VM url (with of course the domain name of the website which I had to hide):

Code: Select all
$menu = & JSite::getMenu();
$item = $menu->getActive();
$id=$item->itemid;

jimport('joomla.language.helper');
$languages = JLanguageHelper::getLanguages('lang_code');
$lang_code = JFactory::getLanguage()->getTag();
$lang_code = 'en-US';
$sef = $languages[$lang_code]->sef;

$siteurl = 'http://----------------/index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.$id;

<gavern:social><div id="gkSocialAPI"></gavern:social>
          <gavern:social><fb:like href="<?php echo $siteurl; ?>" GK_FB_LIKE_SETTINGS></fb:like></gavern:social>


... but again, it gives me an error, but this way at least the "like" url is displayed on my facebook account, which maybe is a good sign :huh:

Any suggestion about how to make this work?

Thanks!
User avatar
Fresh Boarder

GK User
Sun Apr 01, 2012 3:27 am
Hello there,

I have the same issue, did you find any solutions ?
Thanks in advance!
User avatar
Fresh Boarder

GK User
Sun Apr 01, 2012 6:26 am
j02m wrote:Hello there,

I have the same issue, did you find any solutions ?
Thanks in advance!



no, what I did is use an external plugin/module named ItpShare, I don't know if it's the best option for you too, it's complicated for me because I also use Seblod for my content articles, so not every extension are working well. I know there is also a Virtuemart plugin (commercial) that you have to setup in the custom fields if I remember well, but I didn't like it so much. If you wanna know what it was, just tell me, cause I have to look through my mails to find the name.

A+
User avatar
Fresh Boarder


cron