Bug 3215 [REBASED] It would be nice if "Add to Cart" changed to "Remove from Cart"
[koha.git] / opac / opac-ISBDdetail.pl
index 3373787..e9a4c0e 100755 (executable)
@@ -69,6 +69,17 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 my $biblionumber = $query->param('biblionumber');
 
+# get biblionumbers stored in the cart
+my @cart_list;
+
+if($query->cookie("bib_list")){
+    my $cart_list = $query->cookie("bib_list");
+    @cart_list = split(/\//, $cart_list);
+    if ( grep {$_ eq $biblionumber} @cart_list) {
+        $template->param( incart => 1 );
+    }
+}
+
 $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
 $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );