Home › Forums › General Issues › Display product price in Relationship field › Reply To: Display product price in Relationship field
Hi @fanta00
Could you please debug the returned object? You can do it by using var_dump() function like this:
<?php foreach( $posts as $p): ?>
<pre><?php var_dump($p); ?></pre>
This page should give you more idea about it: http://www.advancedcustomfields.com/resources/debug/.
You can also try to set the ID manually like this:
$product = new WC_Product(99);
Where 99 is the ID of your product which has a sale price and regular prices.
Thanks!
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.