Purchase Order Number Required to continue

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hi all,

Just wondering if there is any way I can modify the Purchase Order Plugin to only work when a number is entered.
Even something like a popup reminder to enter the number before finalizing the purchase.
One of our customers has pointed out that even when the Purchase Order field is empty in the cart, the order can still be placed. Does anyone have a solution to this issue?

thanks
3 years ago
For anyone that still needs a resolution to this issue.

Go to the source code for the Payments.PurchaseOrder plugin, go to the PaymentPurchaseOrderController.cs and under the ValidatePaymentForm Action add an if statement and warning as shown below:

[NonAction]
        public override IList<string> ValidatePaymentForm(FormCollection form)
        {

            var warnings = new List<string>();
            if (string.IsNullOrEmpty(form["PurchaseOrderNumber"]))
            {
                warnings.Add("PO Number is required");
            }
            return warnings;
        }

This will stop the user from moving on to the next checkout step and will display the warning to the user in red.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.