100% Off Coupon Problem... and Solution

While testing, I created a "100% Off" coupon.

Yep, everything is totally free during testing!

ZNode worked fine, and even automatically skipped over the payment screens (which was EXACTLY what I wanted since I wasn't testing the payment processing, but what happens post-order).

However, in the Admin screen, you will not be able to list the orders taken through the site if you have used 1 or more "100% off" coupons. The reason is that due to the coupon skipping the payment screens, there is no payment information at all associated with the order. The Order List screen is not prepared to handle that.

The solution is pretty simple. Just add a check for null payment information in Admin/Secure/sales/orders/list.aspx.cs.

Here is the code:

Change "DisplayPaymentType" to:

public string DisplayPaymentType(object Value)
{
if (Value != null)
{
ZNode.Libraries.Admin.OrderAdmin _OrderAdmin = new ZNode.Libraries.Admin.OrderAdmin();
PaymentType _type = _OrderAdmin.GetByPaymentTypeId(int.Parse(Value.ToString()));
return _type.Name.ToString();
}
else
{
return "No Payment";
}
}

Change "DisplayPaymentStatus" to:

public string DisplayPaymentStatus(object Value)
{
if (Value != null)
{
PaymentStatusService serv = new PaymentStatusService();
PaymentStatus ps = serv.GetByPaymentStatusID(int.Parse(Value.ToString()));
return ps.PaymentStatusName.ToString();
}
else
{
return "No Payment";
}

}

and add the following check to the top of "EnableRefund" and "EnableCapture":

if (value == null) return false;

That's it! Now the orders list will no longer throw an error if an order does not have a payment associated.

ZNode Developers: Feel free to use this in the next build, if you wish.

Thanks Again!

Thanks for the update! I will pass this on to the development team to fix in the next version.

Znode Administrator
email: support@znode.com
url: www.znode.com