Promotion: gift with purchase is not saving the gift items
Vote:
Hi
I am programmatically adding a promotion to Epi Commerce. The ype of promotion I am adding is 'Gift with purchase'. Code below:
newDiscount.IsActive = true;
newDiscount.Name = "Free gift with purchase";
newDiscount.Description = "Free gift with purchase";
newDiscount.Condition.Items = targets;//list of ContentReferences
newDiscount.Condition.RequiredQuantity = 1;
newDiscount.Discount.Percentage = 100;
newDiscount.ExcludedItems = new List { SalesCampaignFolder.CampaignRoot }; // Exclude all other discounts from combining with this discount
newDiscount.DiscountTarget = new DiscountItems()
{
Items = freegifts, //List of ContentReferences
MaxQuantity = 1,
};
ContentRepository.Save(newDiscount, SaveAction.Publish, AccessLevel.NoAccess);
The promotion saves fine without any erros. The issue I am experiecing is that the 'free gifts' are not saving, no entries in the 'Get these entries' section. Initially I thought is was a stock issue, but there is enough in inventory.
Hi
I am programmatically adding a promotion to Epi Commerce. The ype of promotion I am adding is 'Gift with purchase'. Code below:
The promotion saves fine without any erros. The issue I am experiecing is that the 'free gifts' are not saving, no entries in the 'Get these entries' section. Initially I thought is was a stock issue, but there is enough in inventory.