I'm working with an ACF relationship field in order to display specific woocommerce products on a single custom post type page. Below code is working fine but I also would like to echo the product SKU and can't figure it out. Below is my current code:
<?php $posts = get_field('linked_realisaties');
if( $posts ): ?>
<?php foreach( $posts as $p): ?>
<a href="<?php echo get_permalink( $p->ID ); ?>">
<?php
echo get_the_post_thumbnail( $p->ID, 'thumbnail' )
?>
<div style="overflow:hidden">
<span><?php the_field('linked_product_1_qty'); ?>x <?php echo $p->post_title; ?></span>
</div>
</a>
<?php endforeach; ?>
<?php endif; ?>