summaryrefslogtreecommitdiffstats
path: root/idrop-web/grails-app/services
diff options
context:
space:
mode:
authormconway <michael.c.conway@gmail.com>2012-10-31 13:49:05 (GMT)
committer mconway <michael.c.conway@gmail.com>2012-10-31 13:49:05 (GMT)
commit871bafc541c69b125983a076571a8ee0b70f4830 (patch)
treec1ceb3e8c8815274b209dee9bd2b796c382d3107 /idrop-web/grails-app/services
parenta0c9f34e55b9860048aa0a542efb65e70846d3d5 (diff)
downloadQCG-Data-871bafc541c69b125983a076571a8ee0b70f4830.zip
QCG-Data-871bafc541c69b125983a076571a8ee0b70f4830.tar.gz
QCG-Data-871bafc541c69b125983a076571a8ee0b70f4830.tar.bz2
[#984] new shopping cart page
Diffstat (limited to 'idrop-web/grails-app/services')
-rw-r--r--idrop-web/grails-app/services/org/irods/mydrop/service/ShoppingCartSessionService.groovy11
1 files changed, 11 insertions, 0 deletions
diff --git a/idrop-web/grails-app/services/org/irods/mydrop/service/ShoppingCartSessionService.groovy b/idrop-web/grails-app/services/org/irods/mydrop/service/ShoppingCartSessionService.groovy
index d2e7aa1..1bd0caa 100644
--- a/idrop-web/grails-app/services/org/irods/mydrop/service/ShoppingCartSessionService.groovy
+++ b/idrop-web/grails-app/services/org/irods/mydrop/service/ShoppingCartSessionService.groovy
@@ -21,6 +21,17 @@ class ShoppingCartSessionService {
FileShoppingCart fileShoppingCart = getCartFromSessionAndCreateIfNotThere()
fileShoppingCart.addAnItem(new ShoppingCartEntry(irodsFileAbsolutePath))
}
+
+ /**
+ * Get a count of items in the cart (right now high level items, trying to cut down on queries)
+ * @return <code>int</code> with count of entries in the cart
+ */
+ public int getCartItemsCount() {
+ FileShoppingCart fileShoppingCart = getCartFromSession()
+ return fileShoppingCart.shoppingCartEntries.size()
+
+ }
+
/**
* List the contents of the cart as a list of file names