Exception is thrown when using a rule with "Total Product Quantity Condition" condition


Description

After adding a personalization rule with "Total Product Quantity Condition" condition to a rendering and then adding several products to a cart, the "Checkout" button is not displayed. The following error occurs in Sitecore XP logs:

ERROR Evaluation of condition failed. Rule item ID: Unknown, condition item ID: {F534DDB9-D2C7-44B5-AA28-3E03878F4A58}
Exception: Microsoft.OData.Client.DataServiceQueryException
Message: An error occurred while processing this request.
Source: Sitecore.Commerce.ServiceProxy
at Sitecore.Commerce.ServiceProxy.Proxy.GetValue[T](DataServiceQuerySingle`1 query)
...

The following error occurs in Commerce Authoring log:

ERROR ClientCertificateValidationMiddleware: Message = Bad Request - Error in query syntax.
Microsoft.OData.Core.ODataException: Bad Request - Error in query syntax.
at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.ExtractSegmentIdentifierAndParenthesisExpression(String segmentText, String& identifier, String& parenthesisExpression)
at Microsoft.OData.Core.UriParser.Parsers.ODataPathParser.CreateFirstSegment(String segmentText)

Solution

To resolve the issue, download and install the patch compatible with the affected product version found on this page:

https://github.com/SitecoreSupport/Sitecore.Support.251521/releases

For more information on this matter, see the "Personalization rules" section of The items installed with Commerce Connect article.