Anzahl der Beiträge:
1
Karma:
5
Beigetreten:
06.03.2010
Herkunft:
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.
Anzahl der Beiträge:
13
Karma:
75
Beigetreten:
01.07.2010
Herkunft:
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