My application is shopping website application. In place order case, I need to pass the sum of every item's price as a one parameter. Prices are coming to the iterator correctly. But I failed to get the sum of those prices. shopping cart list is coming from Another action class.
I tried with this:
<s:iterator value="shoppingCarts" var="shoppingCarts">
<s:label name="total" value="%{#total+(item.salesPrice*qty)+item.shippingCost}" label="Total"/>
</s:iterator>
This shows two labels, if shopping cart list has two items. How can I get a total to a one parameter inside the iterator?
Define a context variable
total
like in this exampe