We are using vendr v1.8.1 and vendr.checkout v1.2.0
During the checkout process we entered a discount code which is invalid, but instead of getting the error message we have a validation summary which is a red div with no message inside
Hmm, OK so it looks like we must have been trying to show the code validation error next to the code field at some point as we give the code error a specific associated field
If we are not specifically displaying the code error somewhere else, you can probably set the Html.ValidationSummary first argument to false and I think it should show the relevant error.
Changing the first argument to "false" does makes the page show the error message, but when the checkout page is loaded we will directly have the red div without even doing anything
I wonder if just removing the first boolean arg fixes it? I find it pretty weird that this hasn't been raised by anyone else though.
Happy to look at introducing the override if it's causing problems, but I guess you could add it as a class in the App_Code folder as an instant workaround and then update the VendrCheckoutMaster.cshtml file accordingly.
This would save you having to upgrade the package for now.
Removing the first boolean arg changed nothing. Still have the red div on page load.
Doing a quick search on google, I found that some old posts (like very old threads from 2011 and 2013) mentioned this issue. I am not sure why it is not fixed though.
For now I will just do a quick workaround as you said.
Vendr checkout empty validation summary
Hi,
We are using vendr v1.8.1 and vendr.checkout v1.2.0
During the checkout process we entered a discount code which is invalid, but instead of getting the error message we have a validation summary which is a red div with no message inside
How can we fix this issue?
Thanks
Is the box actually empty? Or is the text rendered but not shown (ie, could it be red in colour or something?)
It is a div with an empty list
Hmm, OK so it looks like we must have been trying to show the code validation error next to the code field at some point as we give the code error a specific associated field
https://github.com/vendrhub/vendr-checkout/blob/dev/src/Vendr.Checkout/Web/Controllers/VendrCheckoutSurfaceController.cs#L44
However in the validation summary, we seem to be excluding property errors
https://github.com/vendrhub/vendr-checkout/blob/dev/src/Vendr.Checkout/Web/UI/App_Plugins/VendrCheckout/Views/VendrCheckoutMaster.cshtml#L202
And I can't see anywhere in the discount code form anywhere where we try and render the code validation error
https://github.com/vendrhub/vendr-checkout/blob/dev/src/Vendr.Checkout/Web/UI/App_Plugins/VendrCheckout/Views/VendrCheckoutInformationPage.cshtml
If we are not specifically displaying the code error somewhere else, you can probably set the
Html.ValidationSummary
first argument to false and I think it should show the relevant error.Matt
Changing the first argument to "false" does makes the page show the error message, but when the checkout page is loaded we will directly have the red div without even doing anything
Then there must be something else going on.
A validation summary shouldn't show itself unless there is an error on the page.
I found a topic on stackoverflow about validation summary https://stackoverflow.com/a/12111297
Apparently there is a problem with this helper function and doing the thing suggested by the answer does fix this issue.
But if this is the case, the it means that the vendr checkout package might need to be updated
What is your opinion on this? or you have another suggestion?
Hmm, weird 🤔
I wonder if just removing the first boolean arg fixes it? I find it pretty weird that this hasn't been raised by anyone else though.
Happy to look at introducing the override if it's causing problems, but I guess you could add it as a class in the
App_Code
folder as an instant workaround and then update theVendrCheckoutMaster.cshtml
file accordingly.This would save you having to upgrade the package for now.
Matt
Removing the first boolean arg changed nothing. Still have the red div on page load.
Doing a quick search on google, I found that some old posts (like very old threads from 2011 and 2013) mentioned this issue. I am not sure why it is not fixed though.
For now I will just do a quick workaround as you said.
Thanks Matt
Very strange.
Glad you have a workaround nevertheless 👍
Matt
is working on a reply...