I'm a newbie at modifying wooCommerce. I hope someone can help me with a problem i'm having while trying to make a minor change to the plugin to fit with a request from my client.
I'm trying to modify WooCommerce to display the category name for each product. I want the category name to be shown above the product image on the main shop page. (the view where many products are shown on the screen at once)
I've searched around, and i can't seem to find how to call the product->category to get the category name for each product being shown.
In the wooCommerce files, i've found content-product.php
(in templates/content-product.php)
and i'd like to inject the category for each product by adding to this action:
do_action( 'woocommerce_before_shop_loop_item_title' );
I understand that I can add a function in my theme's functions.php to inject some new code into the ''woocommerce_before_shop_loop_item_title'
but I can't work out how to get the category for each product.
can someone help? or tell me where i might be able to find the answer?
any help will be much appreciated, thank you!