woocommerce how to get cat id in content-product.php

Use this

$product_terms = wp_get_object_terms( 17, 'product_cat', array( 'fields' => 'all' ) );

and then get the parent cat id and move all sub cat into an array.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)