The code example that I posted it how you would loop over the recordset once for each item. You will need to create your recordset first. In here you can filter it by the item id by going into the filter section at the bottom. In here you will specify to filter on items id column, then for the value you would enter:
$eCart1->DisplayInfo("ID")
You would need to replace the eCart1 with the name of your cart. Once you have the recordset setup like this you can then manually add in the code to loop over each item in the cart. This will give you a series of recordsets with each one for a specific item in the cart. The looping will need to be done manually as this is not a supported feature of the cart.