---- Reported by gcollum@hotmail.com 2009-05-10 00:40:44 ---- After performing a search in opac, if you click on "Add to Cart" there is feedback that you added an item to the cart, but if you are scrolled far down into your search results the feedback is not visible. It would be nice if "Add to Cart" could change to "Remove from Cart" and that functionality was added for the given bib. It would give the user more feedback and the ability to easily correct a mistake. --- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:07 UTC --- This bug was previously known as _bug_ 3215 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3215 Actual time not defined. Setting to 0.0 The original reporter of this bug does not have an account here. Reassigning to the person who moved it here: chris@bigballofwax.co.nz. Previous reporter was gcollum@hotmail.com.
A basic fix for this has been submitted in Bug 7466 - "Cart notification popup should appear onscreen even when button is offscreen." I'm also working on a more complex fix, wherein each "add to cart" link becomes "In your cart (remove)" where "(remove)" is a link to remove the item from your cart. This feature will be implemented on the search results page, the list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX), and the biblio detail pages.
Screencast example (Flash required, sorry): http://screencast.com/t/UKQPLRyIP5
Created attachment 7387 [details] [review] [PATCH] Bug 3215 - It would be nice if "Add to Cart" changed to "Remove from Cart" "Add to Cart" links in the OPAC should reflect whether a title is already in the Cart. On the results, list, and detail pages the "Add to Cart" link will say "In your cart (remove)" if the title is in your cart. The "(remove)" link will remove the title. This patch adds a check of the biblionumbers in the cart to the relevant scripts and sets a variable for the template governing whether to show "Add to cart" or "In your cart." Pages to test: - the search results page - any detail page (normal, MARC, ISBD) - any list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX) Situations to test: - Add a single item to the Cart from the above pages The link should change from "Add to cart" to "In your cart (remove)" The count of items in your cart should reflect the addition, and the notification box should appear. - Remove a single item from the Cart from the above pages The link should change from "In your cart (remove)" to "Add to cart." The count of items in your cart should reflect the removal, and the notification box should appear. - View an item which is already in the cart from the above pages The cart links should reflect whether the title is already in the cart. - Remove one or more items from the Cart via the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. - Empty the Cart from the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. Tested in Firefox 9, Chrome 16, IE 7, and Opera 11.6 on Win 7
Created attachment 7425 [details] [review] Bug 3215 - It would be nice if "Add to Cart" changed to "Remove from Cart" "Add to Cart" links in the OPAC should reflect whether a title is already in the Cart. On the results, list, and detail pages the "Add to Cart" link will say "In your cart (remove)" if the title is in your cart. The "(remove)" link will remove the title. This patch adds a check of the biblionumbers in the cart to the relevant scripts and sets a variable for the template governing whether to show "Add to cart" or "In your cart." Pages to test: - the search results page - any detail page (normal, MARC, ISBD) - any list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX) Situations to test: - Add a single item to the Cart from the above pages The link should change from "Add to cart" to "In your cart (remove)" The count of items in your cart should reflect the addition, and the notification box should appear. - Remove a single item from the Cart from the above pages The link should change from "In your cart (remove)" to "Add to cart." The count of items in your cart should reflect the removal, and the notification box should appear. - View an item which is already in the cart from the above pages The cart links should reflect whether the title is already in the cart. - Remove one or more items from the Cart via the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. - Empty the Cart from the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. Tested in Firefox 9, Chrome 16, IE 7, and Opera 11.6 on Win 7 Signed-off-by: Liz Rea <wizzyrea@gmail.com> Stepped through test plan - no issues found. prove t xt t/db_dependent congruent with current master failures.
Given that Perl 5.10 is now the minimum version for Koha, it may prove more efficient to use ~~ than grep. For example: if ( grep {$_ eq $biblionumber} @cart_list) { $this_item->{'incart'} = 1; } Becomes if ( $biblionumber ~~ @cart_list) { $this_item->{'incart'} = 1; } Template level changes look good, and code is clean. Just wanted to bring this up to see if anyone had more information or an opinion on the matter before I push through QA
(In reply to comment #5) > Template level changes look good, and code is clean. Just wanted to bring this > up to see if anyone had more information or an opinion on the matter before I > push through QA Not a big deal for me, marking passed QA
Sorry owen, but the patches don't apply anymore CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt Looking at the diff, I think/suspect it's easy to fix. But as it's not trivial, I won't do it myself to avoid doing a mistake. Could you rebase & resubmit (let the "passed QA" status if it appear to be easy, i'll test it myself anyway)
Created attachment 7787 [details] [review] Bug 3215 [REBASED] It would be nice if "Add to Cart" changed to "Remove from Cart" "Add to Cart" links in the OPAC should reflect whether a title is already in the Cart. On the results, list, and detail pages the "Add to Cart" link will say "In your cart (remove)" if the title is in your cart. The "(remove)" link will remove the title. This patch adds a check of the biblionumbers in the cart to the relevant scripts and sets a variable for the template governing whether to show "Add to cart" or "In your cart." Pages to test: - the search results page - any detail page (normal, MARC, ISBD) - any list contents page (/cgi-bin/koha/opac-shelves.pl?viewshelf=XX) Situations to test: - Add a single item to the Cart from the above pages The link should change from "Add to cart" to "In your cart (remove)" The count of items in your cart should reflect the addition, and the notification box should appear. - Remove a single item from the Cart from the above pages The link should change from "In your cart (remove)" to "Add to cart." The count of items in your cart should reflect the removal, and the notification box should appear. - View an item which is already in the cart from the above pages The cart links should reflect whether the title is already in the cart. - Remove one or more items from the Cart via the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. - Empty the Cart from the cart pop-up window View the above pages as you do so to verify that the operation is reflected immediately by the state of the "in your cart" links. Tested in Firefox 9, Chrome 16, IE 7, and Opera 11.6 on Win 7
My original patch didn't apply because since I submitted it a new include was introduced for the OPAC detail pages. The rebased patch moves the changes which were originally in each of the three detail pages into the single new include.
There have been no further reports of problems so I am marking this bug resolved.