It is probably just an issue with the order then. The correct order would have to be:
1) Insert Into table
2) Recordset to get flats amount
3) Add to Cart
I think the server behaviors would apply in a different order by default, so you would have to copy and paste the code to get it into that order.