Guest User

Untitled

a guest
Jun 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. if(isset($_POST['update'])){
  2. foreach($_POST['book'] as $book_id => $amount){
  3. $amount = intval($amount);
  4. if($amount <= 0){
  5. $cart->remove($book_id);
  6. // echo "REMOVING BOOK";
  7. } else {
  8. $cart->update($book_id,"amount",$amount);
  9. // echo "UPDATING BOOK WITH AMOUNT: ".$amount;
  10. }
  11. }
  12. $cart->save();
  13. }
Add Comment
Please, Sign In to add comment