View Single Post
  #258  
Old 02-08-2011, 03:33 PM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: X-Cart Smart Template v4.4.x

Anyone wanting to easily add a Facebook 'Like' button...

In skin/smart_template/custom/common.tpl

At the end, insert...
Code:
<meta property="og:title" content="{$product.producttitle|default:$product.product|escape}" /> <meta property="og:site_name" content="{$config.Company.company_name}" /> <meta property="og:image" content="{$product.image_url|default:$product.tmbn_url}" />
Then in skin/smart_template/customer/main/product_details.tpl

After...

Code:
<div class="ask-question"> {include file="customer/buttons/button.tpl" button_title=$lng.lbl_ask_question_about_product style="link" href="javascript: return !popupOpen(xcart_web_dir + '/popup_ask.php?productid=`$product.productid`')"} </div>
Insert...
Code:
<iframe src="http://www.facebook.com/plugins/like.php?href={$php_url.url|escape:"url"}&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:30px; margin-top:10px"></iframe>
Then run cleanup.php

Source | Demo

I don't have a Facebook account, so I can't test it personally
__________________
xcartmods.co.uk
Reply With Quote