<div class="lp-container">
    <div class="wrap-review-data">
        <h3 class="title"><?php the_field( 'title' ) ?></h3>
        <span class="star"><?php bbase_star( get_field( 'star' ) ) ?></span>

        <div class="des">Đây là thông tin người mua đánh giá shop bán sản phẩm này có đúng mô tả không.</div>

        <?php if( have_rows('reviews') ): ?>
        <div class="list-review">
            <?php while( have_rows('reviews') ) : the_row(); ?>
            <div class="review-item">
                <div class="wrap-review">
                    <div class="wrap-data-star">
                        <div class="avatar">
                            <?php $url = get_sub_field( 'avatar' ) ? get_sub_field( 'avatar' ) : '/wp-content/uploads/2021/11/t-1.jpg' ?>
                            <img src="<?php echo $url; ?>" alt="" />
                        </div>
                        <span class="star"><?php bbase_star( get_sub_field( 'star' ) ) ?></span>
                    </div>

                    <div class="info">
                        <h4 class="name"><?php the_sub_field( 'name' ) ?> <span class="buyer">Đã mua hàng</span></h4>
                        <div class="input"><?php the_sub_field( 'review_text' ) ?></div>

                        <?php $images = get_sub_field( 'galerry' );
                        if( $images ): ?>
                        <ul class="gallery">
                            <?php foreach( $images as $image_url ): ?>
                            <li><img src="<?php echo $image_url; ?>" alt=""></li> 
                            <?php endforeach; ?>
                        </ul>
                        <?php endif; ?>
                    </div>                    
                </div>

                <?php if( have_rows('reply') ): ?>
                <div class="reply-review">
                    <?php while( have_rows('reply') ): the_row(); ?>
                    <div class="review-item">
                        <div class="wrap-review">
                            <div class="avatar">
                                <?php $url = get_sub_field( 'avatar' ) ? get_sub_field( 'avatar' ) : '/wp-content/uploads/2021/11/t-1.jpg' ?>
                                <img src="<?php echo $url; ?>" alt="" />
                            </div>

                            <div class="info">
                                <h4 class="name"><?php the_sub_field( 'name' ) ?> <span class="ad-manager">Quản trị viên</span></h4>
                                <div class="input"><?php the_sub_field( 'review_text' ) ?></div>
                            </div>                    
                        </div>
                    </div> 
                    <?php endwhile; ?>                   
                </div>
                <?php endif; ?>
                
            </div>
            <?php endwhile; ?>
        </div>
        <?php endif; ?>
    </div>
</div>