I had to add a Facebook like button into the product page of an Magento ecommerce website Im working on today. At first, I was getting the URL of the help page (if you can believe that) and then I got the product’s category URL. After digging through many blogs and the Magento API, I finally figured it out.
The Facebook like button code, Im using the inframe version, requires you to insert the url of the page you want people to like. Here’s the code you need to echo a product’s page URL in Magento, its a single echo line of code:
helper('catalog/product')->getProductUrl($_product) ?
Leave a Reply