The Facebook like module does not display on node types of Product. Using Ubercart.

www.australianrobotics.com.au/node/292 is a blog post, works fine
www.australianrobotics.com.au/node/167 is a product and does not display

Comments

daze20’s picture

same here...

break’s picture

Same here.

Permissions are OK on my site
I checked and the "$types_to_like" includes the "product" CCK.
I tried to use the Devel module's dpm($vars), to see whether and what variable of the FBLikeButton module show up, but nothing did.

FYI: I am also using SexyBookmarks and that module has no problem adding code to the Product pages (or blog entries, regular pages...)

Thus I ended up hardcoding the FBLike code into my node-product.tpl.php . Specifically I added the code below onto line 59, right after

<div class="links clear">
          <?php print $links; ?>
        </div>

This is what I added:

	<iframe src="http://www.facebook.com/plugins/like.php?href=<?php 
		    global $base_url;
			print $base_url . '/';
			print drupal_get_path_alias($_GET['q']); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe> 

FYI: My site is not yet public, so I cannot show it to you, but at least the FBLikeButton now shows up. Albeit it is a bit too close to the "add to cart" button. I will put the iframe in a 'div' and CSS it later.

Phoriver’s picture

Awesome, thanks for that code. I just added a "br" before it to space it out nicely!
Thanks again.

Dubber Dan’s picture

Just installed the module and have exactly the same problem. I'd rather not have to hard-code anything as that kinda defeats the object of having a module do the job.

http://www.elementsforlife.co.uk/shop/superfoods/raw-chocolate/raw-cacao... - product page
http://www.elementsforlife.co.uk/yummy-scrummy-raw-chocolate-brownie - standard page

Any chance of this being looked at and fixed byt the devs?

jerdiggity’s picture

Assigned: Unassigned » jerdiggity

That's.... weird (to me). I'll definitely have a look at it to see if I can identify why it would discriminate against "product" node types (and no others).

abx’s picture

Just tried what "break" suggested. It does work but that means you don't really need this module anymore. It will display even "Facebook Like Button" module doesn't installed.

jerdiggity’s picture

Not sure what's going on here, to be honest. I just enabled the module in an e-commerce environment (using Ubercart) and had zero issues.

  1. Have you gone to www.yoursite.com/admin/settings/fblikebutton and enabled product as one of the "likeable" content types?
  2. You said the user permissions have been set, so that's not the issue...
  3. Only other thing I can think of is if -- in your active theme's directory -- there's a file called node-product.tpl.php, that could definitely be preventing the box from showing up. Could you (someone) please check if that's possibly the case? Because otherwise, I'm kind of at a loss here...

I appreciate the feedback either way, though. And if anyone's able to answer #3 above, that would be great too.

:)

j

abx’s picture

Version: 6.x-1.0-rc5 » 6.x-1.1

Just tried 1.1 and got the same result. No Facebook button shows.

I did both question 1 and 2. With question 3, node-product.tpl.php, this should be the problem. I got similar problem on another website that use contemplate. So, I have to put some theme code to make it shows.

However, on both websites, I also use service links module. ( http://drupal.org/project/service_links ) It does show on any content without any problem. (Links will shows on the bottom of content.) No need to modify anything. I don't know what's the different between fblikebutton and service links but it might be useful to take a look at their code.

Thanks for your time.

jerdiggity’s picture

@abx: Just to confirm, did modifying node-product.tpl.php fix the issue?

abx’s picture

I did what "break" suggested by add below code into node-product.tpl.php :

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php
            global $base_url;
            print $base_url . '/';
            print drupal_get_path_alias($_GET['q']); ?>&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>

But with that, there is no need for fbLikeButton module at all.

I also tried 2 things :
1. Remove node-product.tpl.php that is in Acquia Prosper theme folder.
2. Switch theme from Acquia Prosper to Blue Marine.

FB Like Button shows up if I did either method above. So, that should be theme issue.

Still, as I said earlier, I have zero issue with Service Link module at all. I can use any theme and it will always show up without any modification. I hope that this module will do the same.

Thank you,

jerdiggity’s picture

OH ok. Thank you for clarifying that.

Incidentally, @break: you should be able to avoid putting all that code into your file by adding this instead:

print $node->content['fblikebutton_button']['#value'];

This way, you should still be able to customize the output by going to admin/settings/fblikebutton

j

jerdiggity’s picture

Status: Active » Fixed

No responses... Assuming this issue has in fact been resolved.

abx’s picture

<?php
print $node->content['fblikebutton_button']['#value'];
?>

Above code works as it should be. Just place it in theme file. Still, you have to put that in the code manually. The ability to move up or down in FBLikeButton can't be used in this case.

If you don't have any plan to implement something like "Service Link" module. It's better to document it somewhere so user will know what they should do :)

Thank you,

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.