Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-151304

CommerceOrderValidator and CustomCommerceOrderValidator error

Details

    • Bug
    • Status: Closed
    • Resolution: Duplicate
    • 7.4.3.18 CE GA18, 7.4.3.19 CE GA19
    • None
    • Accessibility
    • None
    • Windows 10
    • Apache Tomcat 9.0.x
    • Accessibility

    Description

      I'm following this example https://learn.liferay.com/commerce/latest/en/developer-guide/sales/implementing-a-custom-order-validator.html in order to implement a custom order validator. I noticed that when a new CommerceOrderValidatorResult(TRUE) is returned everything works good, but when a new CommerceOrderValidatorResult(FALSE) is returned then the custom error message doesn't show up and I get this ERROR [http-nio-8080-exec-9][ExceptionMapper:68] null
      com.liferay.commerce.exception.CommerceOrderValidatorException: null
      at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.validate(CommerceOrderItemLocalServiceImpl.java:1164) ~[?:?]
      at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl._createCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:1194) ~[?:?]
      at com.liferay.commerce.service.impl.CommerceOrderItemLocalServiceImpl.addCommerceOrderItem(CommerceOrderItemLocalServiceImpl.java:134) ~[?:?]
      ....
      ....

       

      This error happens also with the default CommerceOrderValidator, for example on a fresh installation when you try to add to cart a product and you don't have enough quantity.

       

      Steps to reproduce:

      1) Install liferay

      2) Create a warehouse

      3) Create a channel

      4) Create a product and in inventory set 5 quantities

      5) Open the product details and add 10 quantities of it to the cart

       

      Actual result:
      Getting a java error and a generic error display message ( danger unable-to-add-the-product-to-the-cart)

      Expected result:
      No errors and a specific error display message (That quantity is unavailable. - showed on Liferay Community Edition Portal 7.3.7 CE GA8)

      Attachments

        Issue Links

          Activity

            People

              support-lep@liferay.com SE Support
              gennaro.lippiello Gennaro Lippiello
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24 weeks, 5 days ago

                Packages

                  Version Package