Woocommerce Force the category choice before creating new product? [duplicate]

You can resolve this issue by simply specifying the taxonomy you want to display.

$dropdown = wp_dropdown_categories( 
array(
    'name' => 'category_id[]', 
    'hide_empty' => false, 
    'echo' => false,
    // Set taxonomy for product categories.
    'taxonomy' => 'product_cat',
  ) );

Before posting here, you should at least do some research on how this code snippet worked for ‘post’, you would’ve found your answer yourself.

Reference :

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)