Home › Forums › Front-end Issues › Output Product or text value from select › Reply To: Output Product or text value from select
$choice = get_field('menu_item_type');
if ($choice == 'checkbox') {
// do something
} elseif ($choice == 'product') {
$product = get_field('pdp_product_one');
// get an acf field from the product
$some_value = get_field('some_field', $product->ID);
// get something else from the product
// see documentation for what you are using for products
}
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.