hello I want to develop a woo-commerce website and JSON API, I want to "get all categories for a product"
<?php
$terms = get_the_terms( '1753', 'product_cat' );
//$nterms = get_the_terms( '1753', 'product_tag' );
foreach( $terms as $term ) {
$product_cat_id = $term->term_id;
$product_cat_name = $term->name;
break;
}