Home › Forums › Add-ons › Repeater Field › Nested repeater fields and conditional statements › Reply To: Nested repeater fields and conditional statements
Hi @eolis
I think you can loop through the product_urls repeater and then check the keys like this:
$productURLsRow = get_field('product_urls');
print_r($productURLsRow);
foreach($productURLsRow as $productURLs){
foreach($productURLs as $key => $productURL){
if(!empty($productURL)){
if($key == 'product_urls_us'){
echo "us";
} elseif ($key == 'product_urls_ca'){
echo "ca";
}
}
}
}
I hope this helps.
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.