What variables are available to the Share button?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi,

I'm not a fan of Addthis and want to add my own share buttons.

If I add the code below into the Share button code: box are there the various variables available to add them in when each different product is requested in the browser?

<a href="http://pinterest.com/pin/create/button/?url=[Producturl]&amp;media=[imageURL]&amp;description=[Product title]%2C%20%C2%A3[price]" class="pin-it-button" count-layout="horizontal">
<img src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>


i.e. what should I replace [Producturl], [imageURL],[Product title],[price] with to get back to the page the code is written on?

Regards,
Renners.
8 years ago
renners wrote:
Hi,

I'm not a fan of Addthis and want to add my own share buttons.

If I add the code below into the Share button code: box are there the various variables available to add them in when each different product is requested in the browser?

<a href="http://pinterest.com/pin/create/button/?url=[Producturl]&amp;media=[imageURL]&amp;description=[Product title]%2C%20%C2%A3[price]" class="pin-it-button" count-layout="horizontal">
<img src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a></div>


i.e. what should I replace [Producturl], [imageURL],[Product title],[price] with to get back to the page the code is written on?

Regards,
Renners.


I think you have to do some hard code.

Open Presentation\Nop.Web\Views\Product\_ShareButton.cshtml

@if (!String.IsNullOrWhiteSpace(Model.PageShareCode))
{
    <div class="product-share-button">
        @Html.Raw(Model.PageShareCode)
    </div>
}


become


<div class="product-share-button">
<a href="http://pinterest.com/pin/create/button/?url=@(Request.Url.AbsoluteUri)&amp;media=@( Model.DefaultPictureModel.ImageUrl)&amp;description=@(Model.Name)%2C%20%C2%A3@(Model.ProductPrice.Price)" class="pin-it-button" count-layout="horizontal">
<img src="//assets.pinterest.com/images/PinExt.png" title="Pin It" /></a>
</div>


Try that to see if it works
8 years ago
Hi,

Thanks for the reply, that worked virtually right out of the box. I only had to adjust my original code slightly as the currency symbol is included automatically and wasn't in my old system.

<a href="http://pinterest.com/pin/create/button/?url=@(Request.Url.AbsoluteUri)&amp;media=@( Model.DefaultPictureModel.ImageUrl)&amp;description=@(Model.Name)%2C%20@(Model.ProductPrice.Price)" class="pin-it-button" count-layout="horizontal">
            <img src="//assets.pinterest.com/images/PinExt.png" title="Pin It" />
        </a>


thanks again.

Regards,
Renners.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.