Julienh / Sharrre

Make your sharing widget! Sharrre is a jQuery plugin that allows you to create nice widgets sharing for Facebook, Twitter, Google Plus (with PHP script) and more.
sharrre.com
MIT License
1.04k stars 411 forks source link

Pinterest media? #241

Open mypersson opened 9 years ago

mypersson commented 9 years ago

It doesn't pull the image on a productpage in Prestashop, probably because I don't know what to write in media. Anyone who knows?

mikeebee commented 9 years ago

Do you have an example page I can look at? You basically need to pass an image url to 'media'

mypersson commented 9 years ago

http://www.cuteness.se/prylar/shappo-nyckelskydd

Thank you

mikeebee commented 9 years ago

Replace your Pintrest code with this...

$('#pinterest').sharrre({
    share: {
        pinterest: true
    },
    buttons: {
        pinterest: {
            media: $('#bigpic').attr('src')
        }
    },
    template: '<a class="box" href="#"><div class="share btn btn-default btn-pinterest social-sharing"><span></span></div><div class="count" href="#">{total}</div></a>',
    enableHover: false,

    enableTracking: true,
    click: function(api, options) {
        api.simulateClick();
        api.openPopup('pinterest');
    }
});

The change being this part...

buttons: {
        pinterest: {
            media: $('#bigpic').attr('src')
        }
    }

That's basically saying "use this image's source as the Pintrest image"

Hopefully it'll work!