It looks like you have you update your store cart summary in database and store cart details in database server behaviors on the main page, and then update the recordset used in the email body.
This is something I could help with in a premier support ticket, but it should be easy enough to do on your own. Make sure you have the latest version of eCart and open and re-apply the two server behaviors that store data in the database using your MySQLi connection.
Then in the email body, just delete the lines you sent and replace it with a MySQLi recordset with the same query. Then find any code that refers to $result2 and update it as well. It looks like only a couple of lines.