Created
June 6, 2015 00:01
-
-
Save ifnull/607ace536b442e3242c6 to your computer and use it in GitHub Desktop.
Magento — Add Pinterest button
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- template/catalog/product/view.phtml --> | |
<!-- Pinterest Button --> | |
<?php | |
$_pinlink['url'] = $_product->getProductUrl(); | |
$_pinlink['media'] = $_product->getImageUrl(); | |
$_pinlink['description'] = $_product->getShortDescription(); | |
?> | |
<a href="http://pinterest.com/pin/create/button/?<?php echo http_build_query($_pinlink) ?>" class="pin-it-button" count-layout="horizontal"></a> | |
<script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Modified from http://stackoverflow.com/questions/9035291/magento-add-pinterest-pin-it-button-to-product-detail-page