Hello,
I have a product in woocommerce, it has a custom field using a page link. This works fine.
When I am on that page, i would like to link back to the woocommerce product and also get all the woocommerce custom fields to use on this page.
this is my first attempt at the code with no luck. I have tried linking with both the current page ID and the permalink, neither work
$current_url = get_permalink();
echo $post->ID;
$args = array(
'numberposts' => 1000,
'post_type' => 'product',
'meta_key' => 'page_link',
'meta_value' => $post->ID
);
$loop = new WP_Query( $args );
echo $loop->request;
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
endwhile;