0

We use the original RWD social share see picture

enter image description here

We have add the LinkedIn Icon and we have open sharing.phtml but we do not know what to insert in the a href=""

<a href="<?php ?>" target="_blank" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Share on LinkedIn')) ?>" class="link-linkedin"><?php echo $this->__('Share on LinkedIn') ?></a>

Do we need JS?

Module is not a possibility for us.

Thanks!

0

Assuming you're trying to achieve product sharing via LinkedIn, add the following to your href attribute:

<?php echo 'https://www.linkedin.com/shareArticle?mini=true&url=' . urlencode(trim($_product->getProductUrl())) . '&title=' . urlencode(trim($_helper->productAttribute($_product, $_product->getName(), 'name'))); ?>

I would recommend following RWD's template flow and use the predefined $_productName and $_productUrl variables respectively. So you would use:

<?php echo 'https://www.linkedin.com/shareArticle?mini=true&url=' . $_productUrl . '&title=' . $_productName; ?>

Resources:

  • Work great the RWD template flow. Thanks bluemwhitew – westh Apr 7 '16 at 14:51
  • No worries! You could also consider including the summary parameter in, but LinkedIn usually scrapes meta/Open Graph data from the URL anyway. – bluemwhitew Apr 7 '16 at 14:54
0

This is the right way to done this, https://developer.linkedin.com/plugins/share when you open this link, choose three options

1) which url you want to share

2) Language

3) Count Mode

click getcode to generate code, you paste this code wherever you want in your template file.

choose appropriate template file using debug mode then paste it.

note: In your case replace the anchor tag above you mention to genrated code

Reference: http://gworks.mobi/blog/category/magento/

  • We want to be able to share our product, not a like button. We already have it for facebook and twitter. Customer can share the product to other poeple. – westh Apr 6 '16 at 22:37
  • hard to find, I felt not enough details have this question add some more details like fb,twitter codes then only compared to linkedin. – Bilal Usean Apr 6 '16 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.