- Posts: 136
- Thank you received: 1
Adding a "Pin it" Pinterest link to Product Pages
Does anyone know of a way to include a "Pin It" button to my product pages?
I have tried using the standard code supplied by Pinterest, but it requires an image to be hardcoded and as I update products very regularly I'd prefer not to have to update the code for each product.
Any help would be greatly appreciated!
Cheers
Please Log in or Create an account to join the conversation.
You can add it in the file "show_default" of the view "product" via the menu Display->Views and it will be added automatically to all the product pages.
Please Log in or Create an account to join the conversation.
nicolas wrote: Hi,
You can add it in the file "show_default" of the view "product" via the menu Display->Views and it will be added automatically to all the product pages.
Hi Nicolas,
I've added the standard Pinterest link to the product -> show_default, together Google, Twitter and Facebook. But the problem is that the standard link requires an image and url link.
Is there any way to hack the standard Pinterest link so that it grabs images and url from the product page?
To show current page url:
AND
Please Log in or Create an account to join the conversation.
The main image URL can be retrieved like that:
$image = reset($this->element->images);
echo $this->image->uploadFolder_url . $image->file_path;
Please Log in or Create an account to join the conversation.
- Posts: 121
- Thank you received: 0
Be a nice feature to have built in I think.
Please Log in or Create an account to join the conversation.
Believe in Better
Please Log in or Create an account to join the conversation.
Here's the instructions:
1) Go to: Display->Views, under all templates, look for your current template. Then look for "show_default" of the front end view "product".
2) Look for this code:
4) Where it says ADD_YOUR_DESCRIPTION_HERE, make sure all ",", ".", "?", "#", "$", "&", etc, are in html codes.
5) To control the CSS for Pinterest, add: ._hikashop_pinterest {} to your template CSS and add in the appropriate CSS controls.
Good luck!
Please Log in or Create an account to join the conversation.
Any help appreciated.
Please Log in or Create an account to join the conversation.
<a class="email" title="Email a friend" href="#" onclick="javascript:window.location='mailto:?subject=Interesting information&body=I thought you might find this information interesting: ' + window.location;">
<a href="javascript:if(window.print)window.print()"><img src="images/print.jpg" alt="Print"></a>
(to go just below the pinterest code then swap images with your own...)
Please Log in or Create an account to join the conversation.
<a href="//www.pinterest.com/pin/create/button/?url=?url=&media=element->images); echo $this->image->uploadFolder_url . $image->file_path; ?>&description=ADD_YOUR_DESCRIPTION_HERE" data-pin-do="buttonPin" data-pin-config="none">

<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script>
Please Log in or Create an account to join the conversation.
- Posts: 24
- Thank you received: 0
Dibben wrote: I have updated this code and this is now what works for me:
<a href="//www.pinterest.com/pin/create/button/?url=?url=&media=element->images); echo $this->image->uploadFolder_url . $image->file_path; ?>&description=ADD_YOUR_DESCRIPTION_HERE" data-pin-do="buttonPin" data-pin-config="none">
<!-- Please call pinit.js only once per page -->
<script type="text/javascript" async src="//assets.pinterest.com/js/pinit.js"></script>
Thank you for this. Is there any way that I can include my product code into the description when someone pins one of my products?
Also 300x300 appears below the image. I cannot work out where it is getting it from or how to remove that.
Thanks in advance
Please Log in or Create an account to join the conversation.
To display the product code, if the previous code is working fine, you can use that code:
Regarding the 300x300, it don't seem to come from that code, could you give a link to the page in question in order to have more clues ?
Please Log in or Create an account to join the conversation.
- Posts: 24
- Thank you received: 0
The 300x300 I was referring to I have discovered is Pinterest showing the size of the image.
A good link to see what I am talking about is : www.douglasjones.co.za/index.php/compone...roduct/1607-orchidea
Thanks for your efforts
Please Log in or Create an account to join the conversation.
It allow to display that pinterest button, and in this plugin change the part for the description content to add the product code.
Else thanks to try:
Please Log in or Create an account to join the conversation.
- Posts: 24
- Thank you received: 0
Thank you for your suggestion. I was not aware of the social plugin, and it works well.
However with the pinterest button, it posts the product perfectly, but in Pinterest when it is posted it just shows "Product Code:" without the product code in it. Any suggestions
Thanks for the time.
Please Log in or Create an account to join the conversation.
Do you mean with the plugin it display just product code without the code of the product in Pinterest ?
Does it work with the previous code you were using ? If it is, you can use the previous code.
With the pinterest plugin, that should not display product code at all, do you have edited the plugin content ?
Please Log in or Create an account to join the conversation.
- Posts: 24
- Thank you received: 0
I have not changed any of the plugin content.
When I click on Pin It, it takes me to the Pinterest window and has the picture of the product and below that its says Product Code:. I would like to work out how to get it to add the product code as well.
Thanks
Please Log in or Create an account to join the conversation.
It looks like this specific product-pin is something that was not available when we developed our Pinterest integration.
That's why you don't have this information. However, looking at their documentation, it looks like it can work with the facebook open graph system which means that if you enable the facebook button it should work.
Let me know how it goes so we can adapt the code!
Please Log in or Create an account to join the conversation.