really, it's just a matter of adding this line to the clear cart code block:
post the code for the clear cart code block from the cart page, and i can update it for you.
as for the mySQL Error, yes, you need to update the database connection file to use the Live Server credentials.
after you have updated the connection file and uploaded it to the server and tested that the live connection works, open the Files panel (Window -> Files). In the Files panel, change the Local View select box to Remote View to view the files on the remote server. Right Click on the connection file and select Set Permissions clear the Write attribute for all three users to make it a read only file.
Now change the files view back to local view. you can update the connection file again on the local computer to connect to your testing server.
By setting the live version of the connection file to be read only, we prevent dreamweaver from being able to overwrite it with the connection file for the local testing server. This allows the local version of the site to connect to the testing servers database, and the live version of the site to connect to the live database.