Woocommerce query all products and categories

You can use wp_get_post_terms()

$categories = wp_get_post_terms(get_the_ID(), 'product_cat', array("fields" => "names"));
print_r($categories);

The names of the product categories are returned as an array so you can either loop through them with a foreach or you can turn it into a string for example:

$categories_list = implode(",", $categories);

If you need more than just the names, you can get return array of the term properties by changing the fields to ‘all’

$categories = wp_get_post_terms(get_the_ID(), 'product_cat', array("fields" => "all"));

http://codex.wordpress.org/Function_Reference/wp_get_post_terms