From 17f1dde1f0a723cc5b57464e70d673218c7c8210 Mon Sep 17 00:00:00 2001 From: nash Date: Thu, 7 Jan 2010 03:09:42 +0000 Subject: 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 --- .../contributions/fullapp-ui/src/main/resources/scatours.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'sandbox/travelsample/contributions') 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'; @@ -294,6 +295,9 @@ itemsHTML += '' + trips[x].fromDate + ' - ' + trips[x].toDate +''; itemsHTML += '' + trips[x].price + ' ' + trips[x].currency + ''; itemsHTML += ''; + if (totalPrice == 0.0) { + currency = trips[x].currency; + } totalPrice = totalPrice + trips[x].price; } else { @@ -308,6 +312,9 @@ itemsHTML += '' + tripItems[i].fromDate + ' - ' + tripItems[i].toDate +''; itemsHTML += '' + tripItems[i].price + ' ' + tripItems[i].currency + ''; itemsHTML += ''; + 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() { -- cgit v1.2.3