diff options
author | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-07 03:09:42 +0000 |
---|---|---|
committer | nash <nash@13f79535-47bb-0310-9956-ffa450edef68> | 2010-01-07 03:09:42 +0000 |
commit | 17f1dde1f0a723cc5b57464e70d673218c7c8210 (patch) | |
tree | ce85da2035d85d870c4eb2276b26bc36360a55da /sandbox/travelsample/contrib | |
parent | 62eb21049ce986abe57992c3c57a78be957b5513 (diff) |
Fix incorrect logic to display currency for items in cart (TUSCANY-3411)
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@896745 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sandbox/travelsample/contributions/fullapp-ui/src/main/resources/scatours.html | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sandbox/travelsample/contributions/fullapp-ui/src/main/resources/scatours.html b/sandbox/travelsample/contributions/fullapp-ui/src/main/resources/scatours.html index e53d4fd27f..52479c1cde 100644 --- a/sandbox/travelsample/contributions/fullapp-ui/src/main/resources/scatours.html +++ b/sandbox/travelsample/contributions/fullapp-ui/src/main/resources/scatours.html @@ -277,6 +277,7 @@ } var itemsHTML = ''; var totalPrice = 0.0; + var currency = '?'; for (var x=0; x<trips.length; x++){ itemsHTML += '<h3>Trip - ' + trips[x].id + '</h3>'; @@ -294,6 +295,9 @@ itemsHTML += '<td>' + trips[x].fromDate + ' - ' + trips[x].toDate +'</td>'; itemsHTML += '<td>' + trips[x].price + ' ' + trips[x].currency + '</td>'; itemsHTML += '</tr>'; + if (totalPrice == 0.0) { + currency = trips[x].currency; + } totalPrice = totalPrice + trips[x].price; } else { @@ -308,6 +312,9 @@ itemsHTML += '<td>' + tripItems[i].fromDate + ' - ' + tripItems[i].toDate +'</td>'; itemsHTML += '<td>' + tripItems[i].price + ' ' + tripItems[i].currency + '</td>'; itemsHTML += '</tr>'; + if (totalPrice == 0.0) { + currency = tripItems[i].currency; + } totalPrice = totalPrice + tripItems[i].price; } } @@ -316,7 +323,7 @@ } document.getElementById('cartItems').innerHTML = itemsHTML; - document.getElementById('cartPrice').innerHTML = totalPrice + ' ' + trips[0].currency; + document.getElementById('cartPrice').innerHTML = totalPrice + ' ' + currency; } function checkout() { |