Question

How do you display the related tags, instead of the related categories at the bottom of the single product page using WooCommerce version 2.1.8?

Was it helpful?

Solution

I would use the woocommerce_after_single_product hook. Then use get_the_tags().

Something like this within your functions.php of your theme:

add_action('woocommerce_after_single_product', 'add_tags_to_product');
function add_tags_to_product() {
  $posttags = get_the_tags();
  if ($posttags) {
    foreach($posttags as $tag) {
      echo $tag->name . ' '; 
    }
  }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top