Hi, I am editing the _Productboxlist view, I would like to add a text box field to the view to make the value of the quantity parameter (fixed to 1 in the standard).
Because the parameter prepares it first
// prepare "Add to cart" AJAX link
do you think I should go to make this parametric?
{@
// prepare "Add to cart" AJAX link
string addtocartlink = "";
var shoppingCartTypeId = (int) ShoppingCartType.ShoppingCart;
var quantity = 1; // make parametric (input text box)
if (Model.ProductPrice.ForceRedirectionAfterAddingToCart)
{
addtocartlink = Url.RouteUrl ("AddProductToCart-Catalog", new {productId = Model.Id, shoppingCartTypeId = shoppingCartTypeId, quantity = quantity, forceredirection = Model.ProductPrice.ForceRedirectionAfterAddingToCart});
}
else
{
addtocartlink = Url.RouteUrl ("AddProductToCart-Catalog", new {productId = Model.Id, shoppingCartTypeId = shoppingCartTypeId, quantity = quantity,});
}
}
<input type="button" value="@(Model.ProductPrice.AvailableForPreOrder ? T("ShoppingCart.PreOrder") : T("ShoppingCart.AddToCart"))" class="button-2 product-box-add-to-cart-button" onclick="AjaxCart.addproducttocart_catalog('@addtocartlink');return false;" />