the cart data is not visible to the function due to variable scope, you will need to do this outside of the function.
Got it --
Moved the code outside of the function; no errors, no update.
<?php echo $bookfair->ConditionalTotal("Quantity", "recID", $row_books['recID']);
outputs a 0.
Perhaps the loop isn't looping??