"Chữ tín và Chất lượng" - Gọi Đặt Hàng : 01677.425.314

Thứ Hai, 7 tháng 7, 2014

Add buton Like Vào product page url

Unknown  /  at  23:20  /  No comments

Adding the Facebook “Like” button to your OpenCart store’s product pages is very simple — You only need to add one line of code to one of your theme file.
This code will work with URL alias (Search engine friendly URL) turned ON or OFF.
Compatibilty: Tested on OpenCart 1.4.9.4, 1.4.9.3, 1.4.9.2 and 1.4.9.1, but should work for all OpenCart versions.
Facebook "Like" button on OpenCart product page

STEP 1

Download this file from your site to your computer:
\catalog\view\theme\YOUR_THEME\template\product\product.tpl
YOUR_THEME is the name of the theme you are currently using.
- if you do not see that file in your theme folder, you need to download the file from the default theme’s folder
\catalog\view\theme\default\template\product\product.tpl

STEP 2

Open the product.tpl file with any text editor.

STEP 3

Copy this code and paste to around line 110
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode('http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']); ?> &amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:35px; margin-top:10px; margin-bottom: 0px"></iframe>
Paste code to your product.tpl file
Just re-upload the file to your server and you’re done:
\catalog\view\theme\YOUR_THEME\template\product\product.tpl

Optional Changes

The line of code that you added to your file has a few parameters that can be changed.
  1. colorscheme=light – change to dark if your site design is in dark color
  2. show_faces=false - change to true if you want to show the small profile pics of the persons who have liked your product
  3. height:35px – if you decide to show the pofile pics, change the height to about 80px or more
NOTES:
  1. Please note that the code may not work if you run your OpenCart store on Windows hosting server.
  2. Facebook has recently changed the “Like” button to behave almost like the “Share” feature. If someone “liked” your product page, Facebook will add the link, summary and a thumbnail picture to his/her profile wall. But the problem is, Facebook may not always choose the right image from your product page to be posted on the Facebook wall.

Share
Posted in: Posted on: Thứ Hai, 7 tháng 7, 2014

0 nhận xét:

Giới thiệu

Chuyên cung cấp sỉ lẻ các quần áo đồ đá banh đẹp, phụ kiện thể thao, áo đấu clb, áo world cup, giày thể thao, Giày Đá Banh Sân Cỏ Nhân Tạo, Giày đá banh sân Futsal..với các thương hiệu Adias, Nike, Puma, Giày đá banh Prowin, Giày đá banh Codad... Website: http://dodabanh.com.vn
Copyright © 2013 Đồ đá banh - Thời trang bóng đá. WP Theme-junkie converted by Bloggertheme9
Blogger templates. Proudly Powered by Blogger.