Hi Dave,
You can limit maximum number units of each item its properties, however this setting is only per-item and cannot be set for a group of items. It also does not limit user from submitting multiple orders matching the item limit, you would need to add such validation directly in the shopping cart methods.
Regarding your second question, Kentico does not offer discounts of this type out of the box, but you can create virtually any item discount you need by overriding this provider method and inserting your custom discount on fly:
public class CustomShoppingCartItemInfoProvider : ShoppingCartItemInfoProvider
{
/// <summary>
/// Returns the list of all discounts which should be applied to the specified shopping cart item.
/// </summary>
/// <param name="item">Shopping cart item</param>
protected override List<IItemDiscount> GetDiscountsInternal(ShoppingCartItemInfo item)
{
List<IItemDiscount> discounts = base.GetDiscountsInternal(item);
if (discounts != null && item != null)
{
DepartmentInfo department = DepartmentInfoProvider.GetDepartmentInfo(item.SKU.SKUDepartmentID);
if (department != null)
{
if (department.DepartmentDisplayName == "Free Samples")
{
// Add aaMyDiscount
ItemDiscount aaMyDiscount = new ItemDiscount
{
ItemDiscountType = DiscountTypeEnum.CustomDiscount,
ItemDiscountValue = 100,
ItemDiscountIsFlat = false,
ItemDiscountedUnits = 3,
ItemDiscountCustomData = null,
ItemDiscountDisplayName = "Free Samples Limit",
ItemDiscountIsGlobal = false,
ItemDiscountID = "ThreeSamplesLimit"
};
discounts.Add(aaMyDiscount);
}
}
}
return discounts;
}
}
This example is somewhat similar to what you ask for, making first three units of any item in department "Free Samples" free. Any first three smartphones in order will be free. Modifying the condition to check for specific SKUID(s) should achieve just what you describe.
Regards,
Josef Dvorak