[Koha] cart button - change or remove

Jos Black jos.kohado at gmail.com
Sat Dec 4 02:46:03 NZDT 2010


Hi Bev

Thanks for sharing this script, I've been wondering abut how to sort this
and it's worked really well here on our install :-)

I've found a couple of examples of the word 'Cart' remaining after I've
added this to the opac syspref though and I'm not sure how to get to them to
convert to our chosen label.  Would you be able to help?

They are:

  in the drop down list 'Add to:' at the top of the brief results list
http://koha/cgi-bin/koha/opac-search.pl

  the header for the pop up http://koha/cgi-bin/koha/opac-basket.pl

Hopefully,
Jos


From: Church, Beverly
<bchurch at ...<http://gmane.org/get-address.php?address=bchurch%2ddH%2fyH1cuEJxBDgjK7y7TUQ%40public.gmane.org>
> >
> Subject: Re: cart button - change or remove<http://news.gmane.org/find-root.php?message_id=%3cAANLkTim7JUMnpoRbKepSiofKn%5fMUkoPAUv%5fKLCqHiMuS%40mail.gmail.com%3e>
> Newsgroups: gmane.comp.misc.koha<http://news.gmane.org/gmane.comp.misc.koha>
> Date: 2010-11-25 13:42:47 GMT (1 week, 23 hours and 55 minutes ago)
>
> Hi Elaine,
>
> Here's a script I found which lets you use the system preference
> "opacuserjs" to rename the cart function. This script below changes "Cart"
> to "Book Bag" but you can use choose any other label:
>
> $("a.addtocart").text('Add to Book Bag');
>
> // redefining messages to use "book bag"
> MSG_BASKET_EMPTY = _("Your book bag is currently empty");
> MSG_RECORD_IN_BASKET = _("This item is already in your book bag");
> MSG_RECORD_ADDED = _("This item has been added to your book bag");
> MSG_NRECORDS_ADDED = _(" item(s) added to your book bag");
> MSG_NRECORDS_IN_BASKET = _("already in your book bag");
> MSG_NO_RECORD_ADDED = _("No item was added to your book bag");
> MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your book
> bag?");
>
>   $(".container > h1:contains('Your Cart')").html("Your Book Bag");
>   $("span.addto").click( function(){
>      $("select#addto > option:contains('Cart')").html("Book Bag");
>   });
>
> top_button_convert = function() {
>   basketcount = $("#basketcount").html();
>   $("#cartmenulink").html(
> '<i></i><span><i></i><span></span><img
> src="/opac-tmpl/prog/images/cart.gif" width="14" height="14" alt=""
> border="0" /> Book Bag<span id="basketcount">' + basketcount +
> '</span></span>'
>   );
> };
>   top_button_convert(); // run once
>   $("a.addtocart").click( function(){
>      top_button_convert();  // run on given clicks
>   });
>
>
> You need to enter the above script between the following beginning and
> opening lines:
>
> $(document).ready(function(){
>
>
> });
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20101203/0ea6ce8a/attachment.htm 


More information about the Koha mailing list