Bug 19241: Waiting items show as available in the cart
authorNick Clemens <nick@bywatersolutions.com>
Tue, 16 Apr 2019 17:21:01 +0000 (17:21 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 10:21:19 +0000 (10:21 +0000)
The cart uses the same item-status.inc that the details page uses, however, we don't
set the waiting or reserved flags. This patch adds those flags to the script

To test:
1 - Find an item on the opac
2 - Place a hold on the item
3 - Check in the item to confirm the hold
4 - Note the details page on OPAC shows 'On hold'
5 - Add the item to a basket
6 - Note the basket shows 'Available'
7 - Apply patch
8 - Check the cart, should show as 'On hold'

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

opac/opac-basket.pl

index d66fd01..c2d57f2 100755 (executable)
@@ -101,6 +101,9 @@ foreach my $biblionumber ( @bibs ) {
     my @items;
     foreach my $item (@all_items) {
         if ( none { $item->{itemnumber} ne $_ } @hidden_items ) {
+            my $reserve_status = C4::Reserves::GetReserveStatus($item->{itemnumber});
+            if( $reserve_status eq "Waiting"){ $item->{'waiting'} = 1; }
+            if( $reserve_status eq "Reserved"){ $item->{'onhold'} = 1; }
             push @items, $item;
         }
     }