Get all commerce product types I am creating a module that needs to add a number of fields to all commerce product types. 
In Drupal 7, I used the function commerce_product_types() to get all the types and than used that, but I can't seem to find the equialent in Drupal 8. So, I have commerce product type 'default', but I also have 'radios', and 'computers'. I don't know how many types there will be on the website, so it needs to automatically detect all types.
Use this: 

/**
* Get all product types
* @return array
*/
public function getProductTypes() {
   $product_types = \Drupal\commerce_product\Entity\ProductType::loadMultiple();
   return array_keys($product_types);
}