0

I need to get WooCommerce Product ID outputted in the single-product page content. I have a table that displays several rows with different stuff, but this table works great to display all the page products. But I want to render it too into the single product page for when someone clicks on the product. I'm having no luck.

<?php echo do_shortcode( sprintf( '[product_table include="" columns="date,tax:remixer,name:Track Name,tax:bpm,categories:Genre,cf:preview,add-to-cart:Buy,price" shortcodes="true" display_page_length="false" links="none" sort_by="date"]', get_queried_object_id() ) ); ?>

This is what I had, but I'm sure is pretty wrong.

 include="<?php $id = $product->id;(); ?>"
cubaton3
  • 31
  • 6

2 Answers2

0
"' . get_the_ID() . '"

Is the correct way!

cubaton3
  • 31
  • 6
0

Woocommerce There are github repository of Woocommerce, you can see which hooks you should edit.

Like:

remove_action( ‘woocommerce_before_main_content’,‘woocommerce_output_content_wrapper’, 10);

add_action(‘woocommerce_before_main_content’, ‘my_content_wrapper_start’, 10);
function my_content_wrapper_start() {
...
}