I'm trying to get or list all category names or IDs of the current product in WooCommerce.
Using this code: I get whole links to the categories but I want their names or IDs.
<?php
// Get list of ALL categories for current product
$cats = wc_get_product_category_list( $id );
var_dump($cats);
?>
I want categories' names or IDs so I can use them to iterate through.