I am using Craft Commerce for the first time and am trying to dynamically generate a dropdown menu that contains links to each product type. I thought the best way to accomplish this would be by using a parameter in the URL i.e.
myurl.com/commerce/products?cat=books
I would be able to get the handle of the selected product type by using:
craft.commerce.products.type(productType).find()
I have two roadblocks that are preventing me from implementing this:
How do I get an array of all the product types so I can build the dropdown?
How do I get the name of a product type once I have the handle so I can display a Header at the top of the page based on the selected product type?
Also, is there a better way of implementing similar functionality that I am simply overlooking?
Thanks!