I am trying to get product category on check out page for showing a special message for shipping for specific category. For this I have created action filter on
woocommerce_available_shipping_methods in theme functions.php
This is my code for getting category here -
global $post; $args = array( 'taxonomy' => 'product_cat',); $terms = wp_get_post_terms($post->ID,'product_cat', $args); print_r($terms);
But it's not giving category on checkout page. Only product ID is one thing I am getting here.
Any help please.
Thanks is advance