I think you can call your cart page with an argument and check that argument when you are processing cart.
e.g.
In product-details.php, call cart.php like this:
<a href cart.php?new=4141>Item blah blah</a>
then in cart.php:
if (isset($GET['new'])
$prod_id = $GET['new']