Facebook “LIKE” on your osCommerce shop

By | April 28, 2010

Jan asks;

possible to put the new like button on osc

Yep, and it’s super simple, using this quick and dirty code.

Step 1: Add this code to your header, footer, or wherever you want the like button to show;


Step 3: Add this code to the bottom of either /includes/footer.php (pre rc3) or includes/template_bottom.php (rc3), making sure to substitute “your app id” with your actual app id;




Code needs to be cleaned up for real use, but this should give you enough of an idea to be able to do what you need to do.

6 thoughts on “Facebook “LIKE” on your osCommerce shop

  1. Jason

    This code works great other than one thing. It doesn’t show up when used in IE. Works fine in Chrome though. Any thoughts?

  2. Gary Post author

    Please make sure to attribute my posts with a working URL. Thanks 😉

    IE requires the js code to be placed the opposite way around. IE, instead of in the footer, hav e it in the header.

  3. Jason

    Strange…I tried that already and still for some reason it doesnt show up but I did notice that it causes IE to give an error regarding a runtime error when that code is placed in the header.

  4. Diana

    so very confused just got my OsC site in August I just don’t know WHERE the facebook code goes how do I get to the header is it in the index.php? Do I have to have a special program to open this? I am really a newbie would appreciate any guidance I have been searching in the forums and online and I am just as confused as ever.

  5. Gary Post author

    1 page in oscommerce can be made of many files. Take the example of “product_info.php”;

    a language file
    any other files that these call
    javascript files
    and more

    Suggest that you need to get straight in your mind how oscommerce hangs together. In general, header edits are done in template_top or header.php

    Any type of text editor will do, eg notepad, ultra-edit. Do NOT use any type os wysiwyg editor such as dreamweaver or frontpage.

Leave a Reply

Your email address will not be published.