Summary: | It would be nice if "Add to Cart" changed to "Remove from Cart" | ||
---|---|---|---|
Product: | Koha | Reporter: | Chris Cormack <chris> |
Component: | OPAC | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Ian Walls <koha.sekjal> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | koha.sekjal, nengard, oleonard, paul.poulain, wizzyrea |
Version: | 3.8 | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7466 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
[PATCH] Bug 3215 - It would be nice if "Add to Cart" changed to "Remove from Cart"
Bug 3215 - It would be nice if "Add to Cart" changed to "Remove from Cart" Bug 3215 [REBASED] It would be nice if "Add to Cart" changed to "Remove from Cart" |
Description
Chris Cormack
2010-05-21 01:07:54 UTC
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. |