implement a free shipping promotion ON purchases 10+

Hi Liferay Community,

I am trying to implement a free shipping promotion (or $0 shipping cost) when a customer purchases 10 or more total items in a single order, regardless of the specific product type or weight.

Here is what I’ve tried so far:

  1. Discounts Rules: I looked under Commerce → Discounts → Rules, but the default rule types available are Cart Total (which evaluates total order amount/price), Has All These Products, and Has Any of These Products. None of these evaluate the total quantity of items in the cart.

  2. Variable Rate Shipping: I checked Channels → Shipping Methods → Variable Rate, but the formula and settings only support weight (Total Order Weight) and order amount (Order Subtotal), rather than total item quantity.

My Questions:

  1. Is there an out-of-the-box setting in Liferay Commerce to evaluate total cart item quantity for discounts or shipping?

  2. If custom development is required, is implementing a custom CommerceDiscountRuleEvaluator OSGi component or CE the recommended approach? If so, could someone share a brief code snippet or best practice for iterating through CommerceOrderItem list to sum up quantities?

Thanks in advance for your guidance!