I'm trying to create a new SalesDiscountProvider to validate voucher codes from diferent tables from a database in C#.
I'm using version 19.1.0.5 ans Cart v1, for now i cannot change that.
I've tried to use the two functions "CreateProductOrderline" and "CreateAmountOrderline" as I saw in an example, but it says it cannot access internal method...
[AddInName("One use Voucher discount")] [AddInDescription("If the user introduces a valid voucher number a discount will be triggered.")] public class OneUseVoucherDiscount : SalesDiscountProvider, IDropDownOptions { #region Parameters [AddInParameter("OrderField"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.DropDownParameterEditor), "")] public string OrderFieldParameter { get; set; } [AddInParameter("VoucherTable"), AddInParameterEditor(typeof(Dynamicweb.Extensibility.Editors.DropDownParameterEditor), "")] public string VoucherTableParameter { get; set; } #endregion public override void ProcessOrder(Order order) { if (order.OrderFields.Contains(OrderFieldParameter)) { string voucherCode = order.OrderFieldValues.GetOrderFieldValue(OrderFieldParameter).Value.ToString(); //TODO seeks if exists on a database table bool isVoucherValid = true; //TODO let's assume it was found if (isVoucherValid) { if (DiscountValue.Type == DiscountTypes.Products) { foreach (Products.Product product in DiscountValue.ProductCollection) { OrderLine line = CreateProductOrderline(order, product);
I also want to subscribe an order complete event as shown at http://developer.dynamicweb-cms.com/documentation/for-developers/ecommerce/extensibility/notifications/cart-v2.aspx but it does not recognize the "
Dynamicweb.Notifications.eCommerce.Cart.CheckoutDoneOrderIsCompleteArgs
" notification. How can i catch the order complete?Thanks,
Diogo Lino