Fixed SQL query in Cart.php

- Fixed SQL queries and an incorrect variable at cart product duplication functions;
- Fixed customized cart product duplication queries, will no longer thrown an exception;
Variable being used here is at Line 3311, it is not and array