Well, you could try this modification:
First add two AppConfig parameters:
Name Type Value
LimitQuantityOnProduct Boolean true/false
QuantityLimit Int number (e.g. 100)
Then under the AspDotNetStorefrontCore.ShoppingCart.GetAddToCartF orm method, add the highlighted parts:
Code:
if (!CustomerEntersPrice && (AppLogic.AppConfigBool("ShowQuantityOnProductPage") && !forKit) || (!AppLogic.AppConfigBool("HideKitQuantity") && forKit))
{
tmpS.Append(" if ((theForm.Quantity.value*1) < 1)\n"); // convert form val to integer
tmpS.Append(" {\n");
tmpS.Append(" alert(\"" + AppLogic.GetString("common.cs.84", SkinID, LocaleSetting) + "\");\n");
tmpS.Append(" theForm.Quantity.focus();\n");
tmpS.Append(" submitenabled(theForm);\n");
tmpS.Append(" return (false);\n");
tmpS.Append(" }\n");
if (AppLogic.AppConfigBool("LimitQuantityOnProduct"))
{
tmpS.Append(" if ((theForm.Quantity.value*1) >="+ AppLogic.AppConfigUSInt("QuantityLimit")+" )\n"); // convert form val to integer
tmpS.Append(" {\n");
tmpS.Append(" alert(\" The limit quantity exceeds and it must called to order\");\n");
tmpS.Append(" theForm.Quantity.focus();\n");
tmpS.Append(" submitenabled(theForm);\n");
tmpS.Append(" return (false);\n");
tmpS.Append(" }\n");
}
if (RestrictedQuantities.Length == 0 && MinimumQuantity != 0)
{
tmpS.Append(" if ((theForm.Quantity.value*1) < VariantMinimumQty_" + ProductID.ToString() + "_" + VariantID.ToString() + ")\n"); // convert form val to integer
tmpS.Append(" {\n");
tmpS.Append(" alert(\"" + String.Format(AppLogic.GetString("common.cs.85", SkinID, LocaleSetting), "\"+VariantMinimumQty_" + ProductID.ToString() + "_" + VariantID.ToString() + " + \"") + "\");\n");
tmpS.Append(" theForm.Quantity.focus();\n");
tmpS.Append(" submitenabled(theForm);\n");
tmpS.Append(" return (false);\n");
tmpS.Append(" }\n");
}
}
and that's it...