Code Snippet – Single item: Practitioner


<?php if(have_rows('hotline_pricing') || have_rows('faire_pricing')): ?>
<div class="grid gap-7 bg-white p-10 rounded-3xl layout">
<h2>Pricing</h2>
<div class="grid grid-cols-[repeat(auto-fill,minmax(min(16rem,100%),1fr))] gap-5 w-full container-[inline-size]">
<?php if(have_rows('faire_pricing')): ?>
    <div class="bg-slate-100 p-5 rounded-3xl flex flex-col gap-2 bg-slate-100">
        <div class="flex gap-2 items-center"><h4>Holistic Faire</h4>
        <div class="flex items-center gap-1">
        <?php
            $output = '';
            $taxonomy = 'faire-option';
            $post_id = get_the_ID();
            $terms = wp_get_post_terms($post_id, $taxonomy);
                    
            foreach ($terms as $term) {
                $svg_icon = get_field('svg_icon', $term); // Get the svg_icon field for the term
                if ($svg_icon) {
                    $output .= sprintf(
                        '<span title="Faire Options: ' . $term->name . '" class="faire-option icon-' . $term->slug . '"></span>',
                        $svg_icon
                    );
                }
            }
            
            echo $output;
        ?></div>
        </div>
        <?php while(have_rows('faire_pricing')): the_row(); 
            $service = get_sub_field('faire_service');
            $price = get_sub_field('faire_service_price');
        ?>
            <div>$<?php echo esc_html($price); ?> for <?php echo esc_html($service); ?></div>
        <?php endwhile; ?>
    </div>
<?php endif; ?>
<?php if(have_rows('hotline_pricing')): ?>
    <div class="bg-slate-100 p-5 rounded-3xl flex flex-col gap-2 bg-slate-100">
        <h4>Intuitive Hotline</h4>
        <?php while(have_rows('hotline_pricing')): the_row(); 
            $service = get_sub_field('hotline_service');
            $price = get_sub_field('hotline_service_price');
        ?>
            <div>$<?php echo esc_html($price); ?> for <?php echo esc_html($service); ?></div>
        <?php endwhile; ?>
    </div>
<?php endif; ?>
</div>

<?php

$appointment_url = get_field('meta_data_hotline_appointment_url'); // Using underscore notation
if($appointment_url): ?>
<div class="flex justify-self-center mt-3">
    <div class="wp-block-buttons practitioner__book-button opacity-85 hover:opacity-100 transition-all duration-300 rounded-full [&_*]:text-base h-auto hover:scale-105">
        <a class="wp-block-button__link wp-element-button rounded-full" href="<?php echo esc_url($appointment_url); ?>">Book Hotline</a>
    </div>
</div>
<?php endif; ?>
</div>
<?php endif; ?>