![]() |
Re: Pinterest
This is what I ended up having for my Pinterest Code... leveraged Cherie's code:
<!-- Pinterest Code --> <!-- Include ONCE for ALL buttons in the page --> <script type="text/javascript"> (function() { window.PinIt = window.PinIt || { loaded:false }; if (window.PinIt.loaded) return; window.PinIt.loaded = true; function async_load(){ var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; if (window.location.protocol == "https:") s.src = "https://assets.pinterest.com/js/pinit.js"; else s.src = "http://assets.pinterest.com/js/pinit.js"; var x = document.getElementsByTagName("script")[0]; x.parentNode.insertBefore(s, x); } if (window.attachEvent) window.attachEvent("onload", async_load); else window.addEventListener("load", async_load, false); })(); </script> {if $main eq "product"} {assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.R EQUEST_URI`"} {assign var=pinitmedia value=$product.images.T.url} {elseif $main eq "catalog" and $current_category.category} {assign var=piniturl value="http://`$config.Company.company_website``$smarty.server.R EQUEST_URI`"} {if $current_category.icon_url} {assign var=pinitmedia value=$current_category.icon_url} {/if} {/if} <a class="addthis_button_pinterest"{if $piniturl} pi:pinit:url="{$piniturl}"{/if}{if $pinitmedia} pi:pinit:media="{$pinitmedia}"{/if} pi:pinit:layout="horizontal"></a> <a href="http://pinterest.com/pin/create/button/&url={$piniturl}&media={$pinitmedia}" class="pin-it-button" count-layout="horizontal">Pin It</a> <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script> <br></br> <!-- End Pinterest Code --> |
Re: Pinterest
Quote:
Does it populate the description? |
Re: Pinterest
Does anyone see a problem with this?
<a href="http://pinterest.com/pin/create/button/?url=http%3A%2F%2Fwww.coffee-authority.com/product.php?productid={$product.productid}&ref=pin terest{$product.productid}&media={$product.image_u rl}&description={$product.product}" class="pin-it-button" count-layout="horizontal"><img border="0" src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a> <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script> It's for x-cart version 4.1.11 Here's a product page that includes the link. This worked fine for a while, but suddenly stopped. I've no clue why. http://www.coffee-authority.com/big-train-blended-ice-coffee-java-chip-3.5lb-bulk-bag.html |
Re: Pinterest
Yea, use what I posted, the second question mark from your url is botching it up, which is why you need to use the urlencode url. Here it is again:
Code:
<a href="http://pinterest.com/pin/create/button/?url={php}echo urlencode('http://www.yoururlhere.com' . $_SERVER['REQUEST_URI']);{/php}&media={$product.image_url}&description={$product.product}" class="pin-it-button" count-layout="horizontal">Pin It</a> |
Re: Pinterest
Yep, that did it. Thanks very much.
|
Re: Pinterest
Could something similar be added to the socialize module or is it best to wait until X-Cart officially adds it? I do have an add-this snippet on my site but I would assume adding it with the rest of them is best.
|
Re: Pinterest
Forgive my ignorance but in what file am I pasting this code in order to make it appear on all product details pages?
|
Re: Pinterest
product.tpl
|
Re: Pinterest
I pasted it into my product.tpl and it does grab the product name, but not the image.
|
Re: Pinterest
I see! My image is
$product.tmbn_url_P not $product.image_url got it! |
All times are GMT -8. The time now is 11:15 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.