Hi Len
Many thanks for your detailed explanation.
Issues:
1. There are two options (we are using the patch, sorry I forgot about
that):
1. use patch from: https://issues.apache.org/jira/browse/OFBIZ-5123
2. use PRIP_PROD_CAT_ID (create a category for each rule and assign
all variants to it)
2. You are right: a bug or a feature?
Promo rules:
We have taken a look to promo rules, but decided to use it only for
promotions.
Meanwhile, I have started changing the ShoppingCartItem implementation
to sum the quantity of variants before price calculation.
But this needs some more testing - let me know if you are interested.
Best regards
Greg
On 05/28/2013 05:40 PM, Len Shein wrote:
Greg,
There are two issues using the price Rules engine in trying to resolve this:
1. The Quantity Price Product rule (PRIP_PRODUCT_ID) does not consider the
virtual product when the variant product id is added to the cart. Therefore
the quantity comparison is not even checked.
2. The Price engine does not sum the 'quantity' in the cart for either the
virtual or the variant product. It is simply comparing the quantity entered
on each cart line against the quantity break rule. This logic works with
'Finished goods' since there can only be 1 cart line in the cart per product
(Finished Good). For example if you add Product 'Finished_Good_A' with a
quantity of '2' and then again add the same Finished_Good_A with a quantity
of '3' the shopping cart would contain 1 cart line with Finished_Good_A and
a quantity of '5'. Since variant products are added to the cart on
separate cart lines the Price Rule Engine Quantity break rules do NOT work.
I have a similar issue and instead of using the Price Rules Engine I am
trying to resolve using the Promotion Engine. The Promotion Engine does sum
the 'quantity in the cart' as well honors the virtual/variant relationship.
Using your example:
o Hat price = 10$
o Qty >= 2, action: Price = 9$
Promotion Engine Rules:
o Condition:
o Cart-Sub Total is > 0
o Action:
o X Quantity for Y Discount
o Quantity: 2 Amount: 1.00
o Product Include: Virtual Hat
Add the following to the cart:
o 1 Quantity of yellow hat (variant)
o 1 Quantity of red hat (variant)
Cart Results
o 1 Yellow Hat price of $9.00
o 1 Red Hat price of $9.00
I understand this seems like the solution, however in my testing, I have
found the Quantity on the 'Action' rule acts as 'equal to' or a 'minimum'.
In my example above all works fine when a sum of quantity for the variant
product is '2'. However if the sum of quantity was '3' then only 2 of the 3
products get the discount.
Cart Results
o 2 Yellow Hat price of $9.00
o 1 Red Hat price of $10.00
I have not noticed a way in the promotion engine to provide a 'range' of
quantity in providing the discount.
Len