<?php
$packages = get_post_meta(get_the_ID(), '_trip_package_price', true);
$currency = (get_option('_webforia_trip_currency') == 'IDR') ? 'Rp' : '$';
?>
<?php $starter_price = get_post_meta(get_the_ID(), '_trip_price_min', true); ?>

<?php if ($packages) : ?>
    <h2 class="wp-block-heading"><?php echo __('Packages Price', 'jelajah-text') ?></h2>
    <div class="rt-package-table wp-block-table is-style-list-value has-small-font-size">
        <table>
            <thead>
                <tr>
                    <th><?php echo __('Package', 'jelajah-text') ?></th>
                    <th><?php echo __('Price', 'jelajah-text') ?></th>
                </tr>
            </thead>
            <tbody>
                <?php foreach ($packages as $key => $package): ?>
                    <tr>
                        <td>
                            <div class="rt-package-table__label"><strong><?php echo $package['label'] ?></strong></div>
                            <div class="rt-package-table__desc has-x-small-font-size has-meta-color leading-lg mt-10"><?php echo $package['desc'] ?></d>
                        </td>
                        <td style="min-width: 150px;"><div class="rt-package-table__price has-medium-font-size md:has-small-font-size"><?php echo wp_sprintf('%s%s', $currency, number_format($package['price'], 0, ',', '.')) ?></div></td>
                    </tr>
                <?php endforeach ?>
            </tbody>
        </table>
    </div>
<?php endif ?>