[ 
https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jennifer Weston updated OFBIZ-1560:
-----------------------------------

    Attachment: OFBIZ-1560.patch

The reason that I posted the patch was that I thought I had solved a similar 
problem. My scenario is a bit more complex, but there are similarties to Raj's 
problem.  Unfortunately, the original patch will not address Raj's issue. A 
revised patch included does.

The problem that got me started on this was that I need a quantity price breaks 
for an item. For example, we have a product that is regularly $99.00. If you 
put 5 to 9 of them in your cart, they should priced as $85.00 per item. If you 
put 10 or more in your cart, they should be $70.00 per item.

After reading about promos and doing some debugging, I found that the quantity 
condition was always treated as a minimum. This works well for Raj's scenario, 
but not mine. It was also confusing as a user. I changed the code to respect 
the user defined comparator. In the process, I noticed that there is some 
interesting behavior regarding how conditions set candidate product quantities. 
This affects how the rules will be applied. The condition will set the minimum 
quantity to satisfy the condition as candidate. I wrongly thought that 
consuming all candidates in the condition would be sufficient to deal with the 
application of the rule actions.

After doing some more debugging, I can now use X Quantity for Y Price which 
works a lot like X Quantity for Y %. The reason it was failing to apply to all 
items was the rule application will apply the action for quantity specified (1 
if not filled in). Then it re-tests all of the rule condition(s). This means 
that once it has applied the action(s) beyond the number that will satisfy the 
condition, it stops.

I've uploaded a new patch that will retry the rule actions until it stops 
changing the cart.

> Promotion rule for quantity discount not working
> ------------------------------------------------
>
>                 Key: OFBIZ-1560
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1560
>             Project: OFBiz
>          Issue Type: Bug
>          Components: product, specialpurpose/ecommerce
>    Affects Versions: SVN trunk
>         Environment: Firefox 2.0, Ubuntu 7.10
>            Reporter: Raj Saini
>            Assignee: Jacques Le Roux
>            Priority: Minor
>         Attachments: OFBIZ-1560.patch, OFBIZ-1560.patch
>
>
> Promotion rule for quantity discount does not work properly. For example if 
> the X product in shopping cart has Qty >= Y, apply  Z% discount to all the 
> quantities in the shopping cart. 
> I have created the following action to achieve the above:
> X Product for Y% discount - Can get the discounted price but this promotion 
> applies to every item i.e. it does not consider the minimum quantity limit.
> If I create the following condition:
> X quantity of Product  - It does apply the minimum quantity condition but 
> applies discount to the item above X. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to