I am working on a custom theme for a woocommerce site. I have a woocommerce.php page set up and I have the detail page for the products set up and working fine I want more control over the tags for the related products and upsell, in other words, I want to be able to change the content of the loop. I am aware i could have a copy of the template but I want to avoid this.
Looking at the templates in the woocommerce folder the single-product/related.php starts with if ( $related_products ) : , doing a var_dump on this file shows an object. I would like to use this variable on my custom page but I can't figure out how to make it available on my page. I have tried using global $related_products to no avail and I have tried the function wc_get_related_products() but all I am getting are the ID's of the related products. I would imagine there is a way to make the variable $related_products available. I will try to do the same with the upsells. Any pointer would be appreciated.