From 9bbc4966baadecb78f76e556dd03d06c98b8007c Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 20 Aug 2018 09:38:49 +1200 Subject: [PATCH] Bug 21174 - Syspref for choosing to load cart popup upon one click on the cart icon. Instead of OPAC users having to click on the cart icon, then having to click on the dropdown box 'Items in your cart:..' to load the cart popup with this syspref enabled OPAC users only need to click once on theOPAC cart icon and the cart popup loads. Test plan: 1. In Koha OPAC click on the cart icon (making sure to have items in the cart and the dropdown box 'Items in your cart:..' appears. 2. Click this dropdown and the cart popup appears. 3. Confirm you can successfully remove items from and empty the cart 4. Apply patch 5. Restart memcached, plack and in koha-shell run ./updatedatabase.pl 6. By default the new syspref in this patch is turned off. Therefore repeat steps: 1,2,3 and confirm they work the same as before you applied the commit 7. In Koha staff client go to Administration->Global system preferences and enable the 'EnableOneClickToOpenCartPopup' preference 8. Back in the OPAC click on the cart icon (making sure to have items in the cart) and notice no 'Items in your: ..' dropdown appears instead the cart popup loads straight away. 9. Confirm the items in your cart is displayed by the cart popup 10. Confirm you can remove items from/empty the cart Sponsored-By: Toi Ohomai Institute of Technology, New Zealand --- ...ref_enabling_loading_of_cart_popup_on_one_click.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 6 ++++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 8 ++++++-- koha-tmpl/opac-tmpl/bootstrap/js/basket.js | 18 +++++++++++++----- 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_21174_syspref_enabling_loading_of_cart_popup_on_one_click.sql diff --git a/installer/data/mysql/atomicupdate/bug_21174_syspref_enabling_loading_of_cart_popup_on_one_click.sql b/installer/data/mysql/atomicupdate/bug_21174_syspref_enabling_loading_of_cart_popup_on_one_click.sql new file mode 100644 index 0000000..cbe42de --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_21174_syspref_enabling_loading_of_cart_popup_on_one_click.sql @@ -0,0 +1 @@ +INSERT INTO systempreferences (variable, value, explanation) values ('EnableOneClickToOpenCartPopup' 0, 'Enable to load the cart popup immediately upon clicking on the OPAC cart icon'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index f46dda3..5b87d4e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -416,6 +416,12 @@ OPAC: no: "Don't allow" - patrons to store items in a temporary "Cart" on the OPAC. - + - pref: EnableOneClickToOpenCartPopup + choices: + yes: Enable + no: "Don't enable" + - Enable to load the cart popup immediately upon clicking on the OPAC cart icon. + - - pref: OpacTopissue choices: yes: Allow diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc index b65af43..7b94a86 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -2,6 +2,7 @@ [% USE Koha %] [% USE Branches %] [% SET OpacLangSelectorMode = Koha.Preference('OpacLangSelectorMode') %] +[% SET CartOneClick = Koha.Preference('EnableOneClickToOpenCartPopup') %]