You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Patrick <pa...@gmail.com> on 2010/02/20 02:33:32 UTC

during the checkout how to grab a list of products at the screen action level?

Depending on the products ordered, I am changing the flow of the
shopping cart.  I need to grab a list of ordered products at the
screen action level either from the parameters or from a db query.
I've found the item
"shoppingCart=org.ofbiz.order.shoppingcart.WebShoppingCart@721c650d"
in the parameters context, so I think I should be able to manipulate
it to give me a list of productIds.   Can you give me a few hints?
Thanks in advance.  Patrick

Re: during the checkout how to grab a list of products at the screen action level?

Posted by Rishi Solanki <ri...@gmail.com>.
If you are getting the object of WebShopiingCart then it is good. Get the
items from shoppingCart.items().
It will return you list of ShoppingCartItem which in turn have product and
productId associated to each item.
shoppingCart.iterator will return iterator of cart items. You can not get
this list from entity as it will not saved till we call for submit order.

Probably you need to add custom method for your own to get list of
productIds. For the same the above information will help.
But my suggestion is to use shoppingCart.items method directly so that you
will get the ShoppingCartItem list which in turn have the product and
productId for each line and other supporting things to display on UI.

Hope that helps.

Rishi Solanki
Enterprise Software Developer
HotWax Media Pvt. Ltd.


On Sat, Feb 20, 2010 at 7:03 AM, Patrick <pa...@gmail.com>wrote:

> Depending on the products ordered, I am changing the flow of the
> shopping cart.  I need to grab a list of ordered products at the
> screen action level either from the parameters or from a db query.
> I've found the item
> "shoppingCart=org.ofbiz.order.shoppingcart.WebShoppingCart@721c650d"
> in the parameters context, so I think I should be able to manipulate
> it to give me a list of productIds.   Can you give me a few hints?
> Thanks in advance.  Patrick
>