You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Raj Saini (JIRA)" <ji...@apache.org> on 2008/01/04 14:53:33 UTC

[jira] Created: (OFBIZ-1560) Promotion rule for quanity discount not working

Promotion rule for quanity discount not working
-----------------------------------------------

                 Key: OFBIZ-1560
                 URL: https://issues.apache.org/jira/browse/OFBIZ-1560
             Project: OFBiz
          Issue Type: Bug
          Components: ecommerce
    Affects Versions: SVN trunk
         Environment: Firefox 2.0, Ubuntu 7.10
            Reporter: Raj Saini
            Priority: Minor


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.


[jira] Assigned: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux reassigned OFBIZ-1560:
--------------------------------------

    Assignee: Jacques Le Roux

> 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: ecommerce, product
>    Affects Versions: SVN trunk
>         Environment: Firefox 2.0, Ubuntu 7.10
>            Reporter: Raj Saini
>            Assignee: Jacques Le Roux
>            Priority: Minor
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767540#action_12767540 ] 

Jacques Le Roux commented on OFBIZ-1560:
----------------------------------------

Hi Raj, Jennifer,

I had a look tonight and here are some remarks.

I did not apply Jennifer's patch yet. What I did was setting a promotion as described Raj :

I used as condition "X Quantities Product" Is Greater Than or Equal is <Qty = 10> 
and Conditions Products: include WG-5569 - Tiny Chrome Widget 

as action "X Product for Y Discount" <Amount = 10>
and Actions Products: Tiny Chrome Widget [WG-5569] - Include 

And here are the results I got :
The promo is not applied until I put more than 10 (despite Greater Than or Equal is <Qty = 10>), when I put at least 11 WG-5569, I get a US$ 10 promo. If you put one more product you still get only the US$ 10 promo, etc.

I also tried to apply the same conditions with the actions
as action "X Product for Y Discount" <qty = 10> <Amount = 10>
and Actions Products: Tiny Chrome Widget [WG-5569] - Include 

It works as you get US$ 10 promo for each product you buy after the tenth. eleventh : US$ 10 promo, twelfth  : US$ 20 promo, etc.

Also Jennifer, was the change you did fixing the issue Raj reported or was it for another reason ?

> 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
>
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677831#action_12677831 ] 

Jacques Le Roux commented on OFBIZ-1560:
----------------------------------------

Hi Raj,

Your example is 
{quote}if the X product in shopping cart has Qty >= Y, apply Z% discount to all the quantities in the shopping cart.{quote}
Does this really means
 "apply Z% discount to all the quantities in the shopping cart." 
or only 
"apply Z% discount to all the quantities of the product X" ?

Which operator did you use in the condition ?

For the action, why not using "Order percent discount"  (if you really want to have  "Z% discount to all the quantities in the shopping cart.". But I suppose you are looking for something else)

In other words, can you elaborate a bit more 
* what you are looking for, 
* how did you try to achieve it
* what did you expect as results 
* and what you really got

Thanks

> 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: ecommerce, product
>    Affects Versions: SVN trunk
>         Environment: Firefox 2.0, Ubuntu 7.10
>            Reporter: Raj Saini
>            Priority: Minor
>
> 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.


[jira] Updated: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jennifer Weston (JIRA)" <ji...@apache.org>.
     [ 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

As of svn revision 824272, the quantity condition for promos are treated as a minimum requirement (i.e. greater than or equal to) instead of respecting the user-set comparator. The enclosed patch alters the logic to respect the user-set comparator for quantity.

> 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
>
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767747#action_12767747 ] 

Jacques Le Roux commented on OFBIZ-1560:
----------------------------------------

Hi Raj,

Yes please do and comment as I'm not sure that I did the same as you. Also could you test Jennifer patch ?

Thanks

> 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
>
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Raj Saini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12677905#action_12677905 ] 

Raj Saini commented on OFBIZ-1560:
----------------------------------

Hi Jacques,

It mean to apply the Z% discount to all the quantities of the X product.

Let me explain a bit what I wanted to achieve. Let us say we want to offer a quantity discount if a customer buys  minimum five number of product X. If customer buys just four numbers we don't want to give this discount. And the discount is Z% of the product price. This was not working when I tested it (almost one year back). The problem was the price % discount was applied irrespective of the number of items in the cart. For example if a customer buys just one number of the product X, Z% discount was offered.

For condition I used "X Quantities Product" Is Greater Than or Equal is <Qty (e.g.10)>

For Action I used "X Product for Y Discount" <Amount (e.g. 10)>

Thanks



> 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: ecommerce, product
>    Affects Versions: SVN trunk
>         Environment: Firefox 2.0, Ubuntu 7.10
>            Reporter: Raj Saini
>            Priority: Minor
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Raj Saini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767744#action_12767744 ] 

Raj Saini commented on OFBIZ-1560:
----------------------------------

Hi Jacques,

I did not looked at the latest code as I had used some work around. I would be glad to test again if you want me to.

> 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
>
>
> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12767543#action_12767543 ] 

Jacques Le Roux commented on OFBIZ-1560:
----------------------------------------

Ha, also I noticed something that makes me wonder : 

{code}
WG-5569 - Tiny Chrome Widget : 14  48,00 $US      -10,00 $US      662,00 $US      
Sous-total:                                                       662,00 $US      
Ajustement - Promotion Détails:                                   -67,20 $US      
Total du panier:                                                  594,80 $US
{code}

The 10% off promo on all the order is still applied to 14*48 = 672, despite than the real order total is really 662 !  Is that normal ? Seems weird to me...


> 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
>
>
> 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.


[jira] Updated: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux updated OFBIZ-1560:
-----------------------------------

    Component/s: product
        Summary: Promotion rule for quantity discount not working  (was: Promotion rule for quanity discount not working)

> 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: ecommerce, product
>    Affects Versions: SVN trunk
>         Environment: Firefox 2.0, Ubuntu 7.10
>            Reporter: Raj Saini
>            Priority: Minor
>
> 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.


[jira] Updated: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jennifer Weston (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Raj Saini (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12770381#action_12770381 ] 

Raj Saini commented on OFBIZ-1560:
----------------------------------

Hi Jacques,

Sorry, I could not get the time so far. I will work on it during this week and update you.

Thanks

> 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.


[jira] Commented: (OFBIZ-1560) Promotion rule for quantity discount not working

Posted by "Jacques Le Roux (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OFBIZ-1560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12769881#action_12769881 ] 

Jacques Le Roux commented on OFBIZ-1560:
----------------------------------------

Hi Raj,

Did you have a chance to look at Jennifer's patch ?

Thanks

> 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.