admin/commerce/products/add page says "You have not created any product types yet" when I have Somehow, the Drupal Commerce page at admin/commerce/products/add is failing to recognise that I have product types and is giving this misleading error:


  You have not created any product types yet. Go to the product type creation page to add a new product type.


From reading this discussion and a look at the code here it looks like the Commerce module on this page bizarrely gets the list of product types from looking at the menus. There's a heap of "what worked for me was moving X to Y in the menus" but they all seem to be slightly different and match older menu naming conventions. This issue appears related but isn't. I have editted the Commerce menu and would like to keep my editted menu how it is.

How can I make sure that Commerce recognised my product types on this page? What has to be where for this page to recognise product types (or even better, is there a way to make it happen the normal way via entities instead of via menus?)

I've also tried bypassing my broken admin/commerce/products/add page completely with a redirect, but the redirect is ignored.

I've also tried moving my Products > Create Item auto-generated menu links back under Store in the Management menu, and creating new menu links to those pages under Store in the Management menu, but neither works.
Those admin pages are generally based on the menu, so I think it makes sense that the commerce module is using the menu to build it.

It doesn't have to be like that, though, you can change it up pretty easily:

function MYMODULE_menu_alter(&amp;$items) {
  $items['admin/commerce/products/add']['page callback'] = 'MYMODULE_commerce_product_ui_add_page';
}

function MYMODULE_commerce_product_ui_add_page() {
  $types = commerce_product_types();  

  if (count($types) == 1) { 
    drupal_goto(_MYMODULE_commerce_product_admin_add_path(key($types)));
  } 

  return theme('MYMODULE_product_add_list', array('types' =&gt; $types));
}

function _MYMODULE_commerce_product_admin_add_path($type) {
  // Method taken from commerce_product_ui_menu()
  return 'admin/commerce/products/add/' . strtr($type, array('_' =&gt; '-'));
}

function MYMODULE_theme() {
  return array(
    'MYMODULE_product_add_list' =&gt; array(
      'variables' =&gt; array('types' =&gt; array()),
    ),
  );
}

function theme_MYMODULE_product_add_list($variables) {
  // Build up an HTML list of links based on $variables['types'], similar to theme_product_add_list()
}