Print Page | Close Window

Facebook LIKE button

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=3651
Printed Date: 26-June-2024 at 7:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Facebook LIKE button
Posted By: CoffeeShop
Subject: Facebook LIKE button
Date Posted: 26-April-2010 at 2:48pm
I'm sure a walk-through will come out soon but for now, how can we add this to the:

- ProductCart Home Page
- every single product item description page?

Thanks!

John



Replies:
Posted By: Greg Dinger
Date Posted: 26-April-2010 at 2:54pm
would this help?
 
http://wiki.earlyimpact.com/widgets/thirdparty/addthis_social_media - http://wiki.earlyimpact.com/widgets/thirdparty/addthis_social_media


-------------
GreyBeard Design Group

Certified ProductCart Developer

Web Design/Development/Hosting

http://tinyurl.com/5c8t4t" rel="nofollow - Add-Ons & Custom Code |


Posted By: Guests
Date Posted: 26-April-2010 at 9:14pm
Hi John,

If you are referring to FB's new Like option on other site networks, I don't really see that as an option at this point. It's not an app, it's not like AddThis -- sharing to your FB profile. It's an option that is build into these other networks and communicates back to FB through an arrangement with them. That's what I understand at this point anyways.

Pretty soon we're going to be adding FB apps for PC, and maybe at that point we'll look into what options may come along for this sort of thing (or maybe AddThis will come up with an option?).

There is no such option, though, right now to the best of my knowledge. However, if you know something I haven't stumbled upon yet, by all means, enlighten us.


Posted By: CoffeeShop
Date Posted: 27-April-2010 at 1:03pm
can you guys take a look at this?

http://cashdoodle.com/2010/04/24/promote-your-art-design-with-facebooks-like-button/

There are also WordPress plug-ins that started taking advantage of the Facebook "Like" button. Please let me know what you think if above is feasible on PC. Thanks!


Posted By: Guests
Date Posted: 27-April-2010 at 3:01pm
Ok, I was completely wrong

Here's what you can do:

Add this within your head tags:

<div id="fb-root"></div>
<script>
window.fbAsyncInit = function()
{ FB.init({appId: 'your app id', status: true, cookie: true, xfbml: true}); };
(function() { var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);}( ));
</script>

Then paste this where you want it to show, perhaps within <div id="pcMainArea08-LINKS"></div>:

<%
Dim strLikeURL, strLikeLayout
'// Layout Options Are: "standard" or "button_count" //'
strLikeLayout = "button_count"
If Request.ServerVariables("HTTPS") = "ON" Then
     strLikeURL = "https://"
Else
     strLikeURL = "http://"
End If
strLikeURL = strLikeURL & Request.ServerVariables("SERVER_NAME")
strLikeURL = strLikeURL & Request.ServerVariables("SCRIPT_NAME")
If Len(Request.ServerVariables("QUERY_STRING") & "") > 0 Then strLikeURL = strLikeURL & "?" & Request.ServerVariables("QUERY_STRING")
%>
<fb:like href="<%=strLikeURL%>"
layout="<%=strLikeLayout%>"
show_faces="false"
width="200"
action="like"
colorscheme="light" />

I'll let someone else play with the CSS on this.


Posted By: CoffeeShop
Date Posted: 27-April-2010 at 3:05pm
Thanks Sean :)

If any PC owners out there started to incorporate this on their websites please post it here so I/we can take a look. To be honest, I don't really want to touch anything on my website until someone else do it on theirs first hehe (sorry I'm not exactly a tech guy, but do understand some basic PC customization).

John


Posted By: Guests
Date Posted: 27-April-2010 at 3:31pm
Here's a development location I've set this up on -- this might not be here for long, though, as this location always has something going on:
http://pc4.wmsmerchantservices.com/productcart/pc/home.asp

[Edit]It's already gone while we work on other issues.


Posted By: Guests
Date Posted: 28-April-2010 at 12:57am
Ok, apparently this doesn't play nice with IE (will someone please write a virus to eradicate IE from the Internet!?)

The JavaScript on this is not my code. I'll leave it to someone else to figure out why the JS from http://cashdoodle.com/2010/04/24/promote-your-art-design-with-facebooks-like-button/ here doesn't work in IE.


Posted By: TrekLightGear
Date Posted: 08-July-2010 at 8:04pm
For those of you still working to integrate the Facebook Like button I found this page which resolved the issue of it not displaying in IE: http://digitizor.com/2010/07/06/fix-facebook-like-button-not-showing-ie/

I've got the Like button successfully added to my page (www.TrekLightGear.com), it's showing in the header up top and is working perfectly on all pages (passing the proper URL, meta data, etc.) with the exception of the product pages which are handled by the SEO feature. It tries to pass the URL as "http://www.treklightgear.com/catalog/pc/404.asp?404;http://www.treklightgear.com/catalog/pc/Double-Hammock-5p2.htm" which is returning an error from Facebook that the page cannot be found.

The problem seems to be that extra 404 that's inserted into the link - any idea how to fix this?

-------------
Seth Haber


Posted By: Guests
Date Posted: 09-July-2010 at 3:00am
Hi Seth,

I did some testing on this earlier today and got some odd results I haven't been able to correlate yet.

I'm going to need to do another run threw tomorrow as I just got too busy today. I think I've an idea of what the issue is here, but not sure how to solve it yet.


Posted By: TrekLightGear
Date Posted: 12-July-2010 at 12:52pm
Sean - Curious to hear what you find out. I really hope there's a way to get it to work with the SEO product pages, it works great for everything else but obviously the product pages are the ones we want people to Like!!

-------------
Seth Haber


Posted By: joshs
Date Posted: 14-July-2010 at 12:57pm
here is a marketing idea that needs some sort of confirmation app.

Give discounts based on friend count. For example 1000 friends - %10 off with a wall post. "TrekLightGear.com just hooked me up with this x product!" Picture attached.

The app would allow the moderator to set discounts or give coupons based on friend network size. More friends equals more exposure equals more "word of mouth" advertising.

-------------
Josh Shirley
josh@windsurfutah.com


Posted By: RedLeafDev
Date Posted: 16-September-2010 at 10:30am
Try this (it has worked for us on numerous sites):
 
1) Go here to get the code for the button: http://developers.facebook.com/docs/reference/plugins/like - http://developers.facebook.com/docs/reference/plugins/like
 
2) Paste the code into the viewPrdC (or L or O) page.
 
3) Make a simple modification to the code where it starts like.php?href=...
 
Place as the URL the site followed by the product as such: http://%5bsite%20url%5d/productcart/pc/viewPrd.asp?idproduct=%3c%=pIdProduct% - http://[site url]/productcart/pc/viewPrd.asp?idproduct=<%=pIdProduct% >
 
And test...
 
Amy


-------------
http://www.redleafdevelopment.com" rel="nofollow - Red Leaf Development

Certified ProductCart Developers

www.redleafdevelopment.com


Posted By: Vincent
Date Posted: 23-October-2010 at 7:26pm
For SEO enabled site I had to use a quick fix using the Replace function.
Based on Sean@WMS code example, thank you Sean.

With the SEO enabled on the site the original link was like the one shown below which created an error 404 while using the facebook link back to the site:

Example:
http://www.yoursite.com/productcart/pc/404.asp?404;http://www.yoursite.com/productcart/pc/Blue-Pinpoint-3p3.htm

I realized then the pattern with the recurring first half of the URL which created the error. I then just decided to use a replace function to get rid of it as it is always the same string.
replace(strLikeURL,"http://www.yoursite.com/productcart/pc/404.asp?404;","")

Here is the final version I implemented on one of my ProductCart Site using SEO (in ViewProdC.asp). Sean Thanks again.

<%
Dim strLikeURL
If Request.ServerVariables("HTTPS") = "ON" Then
      strLikeURL = "https://"
Else
      strLikeURL = "http://"
End If
strLikeURL = strLikeURL & Request.ServerVariables("SERVER_NAME")
strLikeURL = strLikeURL & Request.ServerVariables("SCRIPT_NAME")
If Len(Request.ServerVariables("QUERY_STRING") & "") > 0 Then strLikeURL = strLikeURL & "?" & Server.HTMLEncode(Request.ServerVariables("QUERY_STRING")) end if
strLikeURL = replace(strLikeURL,"http://www.yoursite.com/productcart/pc/404.asp?404;","")
%>
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="<%=strLikeURL%>" layout="button_count"></fb:like>


At the end I find myself with the appropriate URL, based on the example above, it will then return
http://www.yoursite.com/productcart/pc/Blue-Pinpoint-3p3.htm

Note that it is very important to use the SERVER.HTMLEncode()function while using the request object to obtain querystring values:
Server.HTMLEncode(Request.ServerVariables("QUERY_STRING"))

If not, you will then open your site to XSS vulnerabilities which will also affect the PCI Compliance of productcart.


Maybe not the best coding practice but it worked for me.


Posted By: ProductCart
Date Posted: 04-December-2010 at 2:44am
FYI: We recently added an article to the ProductCart WIKI on how to add a Facebook LIKE button

http://wiki.earlyimpact.com/how_to/add_facebook_like_button_ecommerce_store%20 - http://wiki.earlyimpact.com/how_to/add_facebook_like_button_ecommerce_store


-------------
The ProductCart Team

Home of ProductCart http://www.productcart.com" rel="nofollow - shopping cart software



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net