<div id="wpcsr-rate-section" class="wpcargo-row detail-section my-2">
    <div class="wpcargo-col-md-12">
        <p class="header-title"><strong><?php echo wpcsr_rate_information_label(); ?></strong></p>
    </div>
    <?php require_once( wpcsr_include_template('rate-details.tpl') ); ?>
    <div id="wpcsr-rate-packages" class="wpcargo-col-md-12 table-responsive mt-4">
        <p class="header-title "><strong><?php echo wpcsr_packages_label(); ?></strong></p>
        <table class="table wpcargo-table">
            <thead>
                <tr class="text-center">
                    <?php foreach ( wpcargo_package_fields() as $key => $value): ?>
                        <?php 
                            if( in_array( $key, wpcargo_package_dim_meta() ) && !wpcargo_package_settings()->dim_unit_enable ){
                                continue;
                            }
                        ?>
                        <th><strong><?php echo $value['label']; ?></strong></th>
                    <?php endforeach; ?>
                </tr>
            </thead>
            <tbody >
            <?php
            if(!empty($packages) && is_array($packages)) {
                foreach($packages as $package) { ?>
                    <tr>
                        <?php foreach ( wpcargo_package_fields() as $key => $field_value): 
                            $value = array_key_exists( $key, $package ) ? $package[$key] : '' ;
                            if( in_array( $key, wpcargo_package_dim_meta() ) && !wpcargo_package_settings()->dim_unit_enable ){
                                continue;
                            }
                            ?>
                            <td><?php echo $value; ?></td>
                        <?php endforeach; ?>
                    </tr>
                    <?php
                }
            }
            ?>
            </tbody>
        </table>
    </div>
</div>