Hi,
Regarding Order Discounts vs. Vouchers. When applying order discount codes to a sales order in the shopping cart we get an error message that the voucher code is not applied even though that the discount actually is provided to the order (see attached screen dump). The problem as I see it is that the code is checking for vouchers and the order discount id isn't found in the voucherlist. The same code is used if you type in an invalid order discount code. Any input?
foreach (string code in codes)
{
Voucher vouch = Voucher.GetVoucherByCode(code);
if (vouch == null)
{
errors.Add(Translate("Voucher") + " <span class=u-bold>" + code + "</span> " + Translate("not found"));
continue;
}
if (vouch.DateUsed.HasValue)
{
errors.Add(Translate("Voucher") + " <span class=u-bold>" + code + "</span> " + Translate("already used"));
continue;
}
VoucherList voucherList = VoucherList.GetListById(vouch.ListId);
if (!voucherList.ListActive)
{
errors.Add(Translate("Voucher") + " <span class=u-bold>" + code + "</span> " + Translate("is not active"));
continue;
}
// EGWBP.VIKING SOBJA - change translate
<div class="field-success u-margin-bottom dw-mod">@Translate("Voucher code") <span class="u-bold">@code</span> @Translate("applied to order")</div>
}
foreach (string error in errors)
{
<div class="field-error u-margin-bottom dw-mod">@error</div>
}