Woocommerce get products showing in archive page
<p>I'm trying to get all the products showing in an archive page of my shop. I want to get their ids. I'm using a hook of mine which runs on wp_head and checks</p>

<pre><code>if(is_product_category())
</code></pre>

<p>I want to somehow access the query for the products and get their ids.</p>

<pre><code>if(is_product_category()) {
    $current_category = get_queried_object();
    $category_id = $current_category-&gt;term_id;
    $category_name = $current_category-&gt;name;
</code></pre>

<p>This is the code i have so far in order to get the current category id</p>