- 2
Hello guys, we have the smart theme, and i d like to add the SHARE button and ADD TO WHISHLIST to the results page or homepage for each product. How can i do that cleanly ? Thanks !
@if (!Model.ProductPrice.DisableWishlistButton)
{
var addtowishlistlink = Url.RouteUrl("AddProductToCart-Catalog", new { productId = Model.Id, shoppingCartTypeId = (int)ShoppingCartType.Wishlist, quantity = 1 });
<input type="button" value="@T("ShoppingCart.AddToWishlist")" title="@T("ShoppingCart.AddToWishlist")" class="button-2 add-to-wishlist-button" onclick="AjaxCart.addproducttocart_catalog('@addtowishlistlink');return false;" />
}
<!-- Facebook -->
@{
var storeUrL = Nop.Core.Infrastructure.EngineContext.Current.Resolve<Nop.Core.IStoreContext>().CurrentStore.Url.TrimEnd('/');
string realProductUrl = storeUrL + Url.RouteUrl("Product", new { SeName = Model.SeName });
}
<a class="fb-share-link" href="javascript:openProductsShareWindow('https://www.facebook.com/sharer.php?u=@realProductUrl')" target="_blank" style="font-size: 13px;">@T("SevenSpikes.FacebookShop.Public.ProductBox.ShareToFacebook")</a>
function openProductsShareWindow(url) {
var winWidth = 520;
var winHeight = 400;
var winTop = (screen.height / 2) - (winHeight / 2);
var winLeft = (screen.width / 2) - (winWidth / 2);
window.open(url, 'sharer', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight);
}