You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "David E. Jones (JIRA)" <ji...@apache.org> on 2008/12/27 02:37:44 UTC

[jira] Commented: (OFBIZ-2105) ShoppingCart.addOrIncreaseItem

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

David E. Jones commented on OFBIZ-2105:
---------------------------------------

Why not use the ShoppingCart.addItemToEnd or addItem methods, neither of which do this check.

There's no reason to add a parameter to do that. Also, in general I am 100% against adding parameters to that method and would in fact like to see that method signature (addOrIncreaseItem and some similar ones too) super-simplified as right now it is ridiculously large and a bad design that evolved in bad ways and hasn't been cleaned up with. Of course, that doesn't really matter for this, the point is the functionality already exists. If it doesn't already exist, then it should be implemented using a better design to not perpetuate this unfortunate direction.

If there is something not handled by current method please respond, otherwise we'll close this issue.

> ShoppingCart.addOrIncreaseItem
> ------------------------------
>
>                 Key: OFBIZ-2105
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2105
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: order
>    Affects Versions: SVN trunk
>         Environment: Windows XP
>            Reporter: Stephen Rufle
>             Fix For: SVN trunk
>
>         Attachments: 2008-12-23_001_shoppingcart_package.patch
>
>
> Adding a parameter to ShoppingCart.addOrIncreaseItem(... ,
> boolean checkItemsExists) this allows for the adding of a new line item instead of just increasing the quantity.

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


Re: [jira] Commented: (OFBIZ-2105) ShoppingCart.addOrIncreaseItem

Posted by David E Jones <da...@hotwaxmedia.com>.
It's not tough... just write a little code.

-David


On Dec 26, 2008, at 7:16 PM, Stephen Rufle wrote:

> The reason for my request was that in
> ShoppingCartHelper.addToCart(...) line 235 calls addOrIncreaseItem.
>
> Is there a better way to create Items and add them to a ShoppingCart?
>
>
> David E. Jones (JIRA) wrote:
>>    [ https://issues.apache.org/jira/browse/OFBIZ-2105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659298 
>> #action_12659298 ]
>>
>> David E. Jones commented on OFBIZ-2105:
>> ---------------------------------------
>>
>> Why not use the ShoppingCart.addItemToEnd or addItem methods,  
>> neither of which do this check.
>>
>> There's no reason to add a parameter to do that. Also, in general I  
>> am 100% against adding parameters to that method and would in fact  
>> like to see that method signature (addOrIncreaseItem and some  
>> similar ones too) super-simplified as right now it is ridiculously  
>> large and a bad design that evolved in bad ways and hasn't been  
>> cleaned up with. Of course, that doesn't really matter for this,  
>> the point is the functionality already exists. If it doesn't  
>> already exist, then it should be implemented using a better design  
>> to not perpetuate this unfortunate direction.
>>
>> If there is something not handled by current method please respond,  
>> otherwise we'll close this issue.
>>
>>
>>> ShoppingCart.addOrIncreaseItem
>>> ------------------------------
>>>
>>>                Key: OFBIZ-2105
>>>                URL: https://issues.apache.org/jira/browse/OFBIZ-2105
>>>            Project: OFBiz
>>>         Issue Type: Improvement
>>>         Components: order
>>>   Affects Versions: SVN trunk
>>>        Environment: Windows XP
>>>           Reporter: Stephen Rufle
>>>            Fix For: SVN trunk
>>>
>>>        Attachments: 2008-12-23_001_shoppingcart_package.patch
>>>
>>>
>>> Adding a parameter to ShoppingCart.addOrIncreaseItem(... ,
>>> boolean checkItemsExists) this allows for the adding of a new line  
>>> item instead of just increasing the quantity.
>>>
>>
>>
>
> -- 
> Stephen P Rufle
> srufle@salmonllc.com
> H1:480-626-8022
> H2:480-802-7173
> Yahoo IM: stephen_rufle
> AOL IM: stephen1rufle
>


Re: [jira] Commented: (OFBIZ-2105) ShoppingCart.addOrIncreaseItem

Posted by Stephen Rufle <sr...@salmonllc.com>.
The reason for my request was that in
ShoppingCartHelper.addToCart(...) line 235 calls addOrIncreaseItem.

Is there a better way to create Items and add them to a ShoppingCart?


David E. Jones (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/OFBIZ-2105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659298#action_12659298 ] 
>
> David E. Jones commented on OFBIZ-2105:
> ---------------------------------------
>
> Why not use the ShoppingCart.addItemToEnd or addItem methods, neither of which do this check.
>
> There's no reason to add a parameter to do that. Also, in general I am 100% against adding parameters to that method and would in fact like to see that method signature (addOrIncreaseItem and some similar ones too) super-simplified as right now it is ridiculously large and a bad design that evolved in bad ways and hasn't been cleaned up with. Of course, that doesn't really matter for this, the point is the functionality already exists. If it doesn't already exist, then it should be implemented using a better design to not perpetuate this unfortunate direction.
>
> If there is something not handled by current method please respond, otherwise we'll close this issue.
>
>   
>> ShoppingCart.addOrIncreaseItem
>> ------------------------------
>>
>>                 Key: OFBIZ-2105
>>                 URL: https://issues.apache.org/jira/browse/OFBIZ-2105
>>             Project: OFBiz
>>          Issue Type: Improvement
>>          Components: order
>>    Affects Versions: SVN trunk
>>         Environment: Windows XP
>>            Reporter: Stephen Rufle
>>             Fix For: SVN trunk
>>
>>         Attachments: 2008-12-23_001_shoppingcart_package.patch
>>
>>
>> Adding a parameter to ShoppingCart.addOrIncreaseItem(... ,
>> boolean checkItemsExists) this allows for the adding of a new line item instead of just increasing the quantity.
>>     
>
>   

-- 
Stephen P Rufle
srufle@salmonllc.com
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle