Woocommerce get the Archive/Category slug of the current category page

If you are working in the “archive.php” template, you could try this code:

global $post; //maybe not needed

$category = get_the_category($post->ID);
$slug = $category[0]->slug; // try print_r($category); to see everything

echo $slug;