/** * Returns shipping options table * * @param int $product_id * @param array $v_single_names * @return string */ function get_shipping_options_table($product_id, $v_single_names = null) { $single_names = isset($v_single_names) ? $v_single_names : get_single_names(); $shipping_values = get_shipping_options($product_id); $table = ''; if ($shipping_values != 'none') { $table .= '<table class="shipping-table">'; $table .= '<tr>'; $table .= '<td>'; $table .= $single_names['product_shipping']; $table .= '</td>'; $table .= '<td>'; $table .= '<ul>'; foreach ($shipping_values as $i => $shipping_value) { if ($shipping_value != null) { $table .= '<li>' . get_shipping_label($i, $product_id) . ' : ' . price_format($shipping_value) . '</li>'; } } $table .= '</ul>'; $table .= '</td>'; $table .= '</tr>'; $table .= '</table>'; } return $table; }
?> <table class="shipping-table"> <tr> <td class="shipping-label"><?php echo $single_names['product_shipping']; ?> </td> </tr> <tr> <td> <ul><?php foreach ($shipping_values as $i => $shipping_value) { $shipping_value = price_format($shipping_value); if (!empty($shipping_value)) { ?> <li><?php echo get_shipping_label($i, $product_id); ?> : <?php echo $shipping_value; ?> </li><?php } } ?> </ul> </td> </tr> </table> <?php }