You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Jacques Le Roux (JIRA)" <ji...@apache.org> on 2013/07/22 09:30:50 UTC

[jira] [Comment Edited] (OFBIZ-4291) No method to remove a promo code from the shopping cart

    [ https://issues.apache.org/jira/browse/OFBIZ-4291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13714970#comment-13714970 ] 

Jacques Le Roux edited comment on OFBIZ-4291 at 7/22/13 7:29 AM:
-----------------------------------------------------------------

=== BETTER COMMENT === 
Hi Harsha,

Apart that you forgot to put the line
import java.util.Set;
in your patch for ShoppingCartEvents.java, it works. 

But if we go this way (which I agree is better) there is another quirk in the UI, because if you add another promo code to a promotion whith one already (I added 9022 to 9021) then you can remove only the initial promo code, not the new one. I only tested and did not check code. 

I noticed that I you add another promo code in the cart page (in eCommerce) then this new promo code does not show in the list of promotion in "Promotion Information:" section and when you remove the initial one the section is not updated but if you add another promo code then the section is updated.

To be more clear, steps:
# add a new promo code for a promotion in backend (I added 9022 to 9021 rule)
# add the initial code of this promotion in cart after buying 1 Tiny Chrome Widget
# add the new code of this promotion (state: still only a line with the initial promo code shows for this promotion)
# remove the initial code of this promotion (state: the line is removed, the other still not show)

Also as Ankit commented this is not enough, we need also to remove the possibly free products added with a promotion if we remove the associated promo code. That's why I reopen this issue

# add a new promo code for another promotion in backend (I added 90000 to 900)
# back to cart add 90000 code (state: the line for 9022 and 90000 show)
# remove the 90000 promo line (state: the free Micro Chrome Widget is still there)

Thanks!
                
      was (Author: jacques.le.roux):
    Hi Harsha,

Apart that you forgot to put the line
import java.util.Set;
in your patch for ShoppingCartEvents.java, it works. 

But if we go this way (which I agree is better) there is another quirk in the UI, because if you add another promo code to a promotion whith one already (I added 9022 to 9021) then you can remove only the initial promo code, not the new one. I only tested and did not check code. I noticed that I you add another promo code in the cart UI (in eCommerce) then the list of promotion in "Promotion Information:" section is updated, but not if you simply refresh the page (anyway you should not have to even refresh)

Also as Ankit commented this is not enough, we need also to remove the possibly free products added with a promotion if we remove the associated promo code. That's why I reopen this issue

Thanks!
                  
> No method to remove a promo code from the shopping cart
> -------------------------------------------------------
>
>                 Key: OFBIZ-4291
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4291
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: Release Branch 10.04
>            Reporter: Glyton Camilleri
>            Assignee: Jacques Le Roux
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4291.patch, unapplyPromotion.txt, Updated-Ofbiz-4291.patch, Updated-Ofbiz-4291.patch
>
>
> Hi,
> When working with promotions and promo codes in the shopping cart, it seems not possible to remove _one_ specific promo code from the cart neither through the ShoppingCart and its helpers and services, nor through the ProductPromoWorker.
> ShoppingCart has the method 
> {{addProductPromoCode(String productPromoCodeId, LocalDispatcher dispatcher)}}
> but no method to remove the added PromoCode. Is there any other worker, service or event that can be called to do this? And if not, is there a specifc reason (maybe relating to promotions application rules) for not implementing this?
> Any response is appreciated.
> Thanks

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira