Support

Account

Home Forums General Issues How to get field data from a group inside a group Reply To: How to get field data from a group inside a group

  • <div class="war-front-form">
    	<?
            php if( have_rows('warranty-member') ): //parent group field
    	while( have_rows('warranty-member') ): the_row(); 
    	// vars
    	   $name = get_sub_field('warranty-name');
    	   $birth = get_sub_field('warranty-birth');
    	   $phone = get_sub_field('warranty-phone');
    	   $email = get_sub_field('warranty-email');
    	?>
    	  <div class="war-front-member">
    	    <h1>고객정보</h1>
    	     <ul>
    		<li><span>이름</span><p><?php echo $name ?></p></li>
    		<li><span>생년월일</span><p><?php echo $birth ?></p></li>
    		<li><span>연락처</span><p><?php echo $phone ?></p></li>
    		<li><span>이메일</span><p><?php echo $email ?></p></li>
    		<li>
    		 <?php if( have_rows('warranty-adress-group') ): //child group field
                     while( have_rows('warranty-adress-group') ): the_row(); 
    		    // vars
    		      $postcode = get_sub_field('warranty-postcode');
    		      $adress = get_sub_field('warranty-adress');
    		      $adress2 = get_sub_field('warranty-adress-2');
    		    ?>
    		    <span>주소</span>
    		    <p><?php echo $postcode ?></p>
    		    <p><?php echo $adress ?></p>
    		    <p><?php echo $adress2 ?></p>
    							
    		<?php endwhile; ?>
    		<?php endif; ?>
    		</li>
    	     </ul>
          </div>
    <?php endwhile; ?>
    <?php endif; ?>

    this is my group in group source code