Mod note: threads merged
Hate to say this, but it looks like you are randomly asking for help, then randomly incorporating the suggestions. This is a painful and tedious way to learn PHP and develop your script.
You need to start thinking like a programmer, and for this you need to sit down, read a good book or online tutorial, learning the tools of the trade by trying out the examples in the book/tutorial.
How do I display the products, upon clicking the link contained in the writeShoppingCart() function?
test.php will display the products. If this page is test.php, then you need some way to differentiate between the "display products" function being used and otherwise. Typically, we would use the query string in the link's URL for this. It looks like you are already doing this with $_GET['action'], so perhaps the link URL should be: "test.php?action=display".
Also, upon executing the 'add' case within the switch statement, how do I also display the products?
Just print the list of products.
The products should also get displayed if the user manually enters the .php file, via entering the file path into their browsers address bar. How do I do this?
JUst print the list of products. In fact, it sounds like this page will print the list of products no matter what, so you would print after all the conditional logic of adding is done.