You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made a custom field with several validators and attached it to the field layout of an order. It's kinda like Amazons limited time deals so by the time a customer adds the item to the cart the validation may pass but when he/she waits for too long the deal might be already "closed"/out of stock or whatever unfortunately The PaymentsController doesn't return validation errors of the order
So the only information are the $customError and the payment form. While the payment form might be totally correct the order itself could have errors. Currently I need to either create a 2nd Ajax request just to receive those errors or create a custom controller to change this one line.
Is there any chance to include those errors as well?
if ($request->getAcceptsJson()) {
return$this->asJson(
[
'orderError' => $order->getErrors(), // <-- include the order errors'error' => $customError,
'paymentForm' => $paymentForm->getErrors()
]
);
}
The text was updated successfully, but these errors were encountered:
An update has been pushed for this to be included in the next release. The JSON response data now includes order and similarly to paymentFormincludes the errors for the order (if there are any).
Description
I made a custom field with several validators and attached it to the field layout of an order. It's kinda like Amazons limited time deals so by the time a customer adds the item to the cart the validation may pass but when he/she waits for too long the deal might be already "closed"/out of stock or whatever unfortunately The
PaymentsController
doesn't return validation errors of the orderSo the only information are the
$customError
and the payment form. While the payment form might be totally correct the order itself could have errors. Currently I need to either create a 2nd Ajax request just to receive those errors or create a custom controller to change this one line.Is there any chance to include those errors as well?
The text was updated successfully, but these errors were encountered: