I am unsure about how i find the problem, you suggest debugging?? The cart now is visible on the server with the () brackets removed from the if statement. However it is still not looping through to pass item_name_1, item_name_2 etc to paypal.
Because there are two loops in this,
<?php...