Error returned from a cart validation not displaying on site correctly.

Error returned from a cart validation not displaying on site correctly.

MatthewGerdan
Shopify Partner
5 0 0

Hi Everyone,

 

Running into an issue with a cart validation. (I have a hunch this has more to do with the theme)

We are setting this up for a B2B site using the Trade theme. 

I have 2 different cart validations running. Both are quite simple.

One will prevent checkout if a Boolean on the company object is set to true.

The other calculates the available quantity based on the current market of the customer and prevents checkout if attempting to purchase more than what is available.

The extensions work perfect in the DEV site I have set up in the partner account using the test-data theme but in our live production account I am getting issues with how the error is displayed to the user.

Instead of displaying the correct error message I am getting a default one. The error is only displayed when the cart should be prevented and there are no errors in the logs for the extension.

MatthewGerdan_0-1723769575750.png

The network request also looks to be returning the correct value in the body

MatthewGerdan_1-1723769767789.png

Switching the theme to an unedited version of "Trade" the error message will now display along with the generic message (we haven't done any customisation to outside of what can be done in the editor) 

MatthewGerdan_2-1723769901837.png

 

 

Reply 1 (1)

Liam
Community Manager
3108 340 871

Hi Matthew - are you still seeing this issue?

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog