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
[email protected]
H1:480-626-8022
H2:480-802-7173
Yahoo IM: stephen_rufle
AOL IM: stephen1rufle