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:
-
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, andHas Any of These Products. None of these evaluate the total quantity of items in the cart. -
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:
-
Is there an out-of-the-box setting in Liferay Commerce to evaluate total cart item quantity for discounts or shipping?
-
If custom development is required, is implementing a custom
CommerceDiscountRuleEvaluatorOSGi component or CE the recommended approach? If so, could someone share a brief code snippet or best practice for iterating throughCommerceOrderItemlist to sum up quantities?
Thanks in advance for your guidance!