I try to use wc_get_products in functions.php in WordPress. However, I have 2 problems. I only can see the data when using var_dump and the response is missing related_ids (relatable product id's).
The original WooCommerce api call /wp-json/wc/v3/products does return the related_ids (when calling from e.g. postman). BUT the wc_get_products()in PHP does not.
Code in functions.php
$productArgs = array(
'numberposts' => -1,
'post_status' => 'published',
'include' => array(108903),
);
$products = wc_get_products( $productArgs );
var_dump($products);
return $products;
I use the follow documentation: https://github.com/woocommerce/woocommerce/wiki/wc_get_products-and-WC_Product_Query, but I don't see any information about related product id's.