投稿総数:
1
カルマ:
5
参加:
2010/03/06
ロケーション:
Germany
Hi, I want to add a product in my own aspx to the basket of the visitor. My files are in the same application as nopCommerce and I have referenced the nop dlls. Is there a way to add a specific product to the basket in the user session? Thanks in advance.
投稿総数:
13
カルマ:
75
参加:
2010/07/01
ロケーション:
United States
Based on RouteProvider: routes.MapLocalizedRoute("AddProductToCart", "cart/addproduct/{productId}", new { controller = "ShoppingCart", action = "AddProductToCart" }, new { productId = @"\d+" }, new[] { "Nop.Web.Controllers" }); 1- from this code below <input type="button" value="@T("ShoppingCart.AddToCart")" class="productlistaddtocartbutton" onclick="setLocation('@(@Url.RouteUrl("AddProductToCart", new { productId = Model.Id }))')" /> you can use Url.RouteUrl and pass the id of the product you want to add 2-from the html side you can do like this: <a href='yourwebsite/cart/addproduct/id'>Add To Cart</a> id=product id