function eo_get_available_order_totals_class_values($oID) { global $db; $retval = array(); // Remove order totals already present in the order $module_list = explode(';', str_replace('.php', '', MODULE_ORDER_TOTAL_INSTALLED)); $order_totals = eo_get_order_total_by_order($oID); if ($order_totals !== null) { foreach ($order_totals as $class => $total) { if ($class == 'ot_local_sales_taxes') { continue; } $keys = array_keys($module_list, $class); foreach ($keys as $key) { unset($module_list[$key]); } } } // Load the order total classes require_once DIR_FS_CATALOG . DIR_WS_CLASSES . 'order_total.php'; $order_totals = new order_total(); foreach ($module_list as $class) { if ($class == 'ot_group_pricing' || $class == 'ot_cod_fee' || $class == 'ot_tax' || $class == 'ot_loworderfee') { continue; } $retval[] = array('id' => $class, 'text' => $GLOBALS[$class]->title, 'sort_order' => $GLOBALS[$class]->sort_order); } unset($module_list, $order_totals, $class, $total, $keys, $key); return $retval; }
<tr> <td valign='top'> <br> <?php echo '<a href="' . zen_href_link(FILENAME_EDIT_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oID . '&action=add_prdct', 'NONSSL') . '">' . zen_image_button('button_add_product.gif', TEXT_ADD_NEW_PRODUCT) . '</a>'; ?> </td> <td align='right'> <table border="0" cellspacing="0" cellpadding="2"> <?php // Iterate over the order totals. for ($i = 0, $index = 0, $n = count($order->totals); $i < $n; $i++, $index++) { ?> <tr><?php $total = $order->totals[$i]; $details = array_shift(eo_get_order_total_by_order((int) $oID, $total['class'])); switch ($total['class']) { // Automatically generated fields, those should never be included case 'ot_subtotal': case 'ot_total': case 'ot_tax': case 'ot_local_sales_taxes': ?> <td align="right"> </td> <td class="main" align="right"><strong><?php echo $total['title']; ?> </strong></td> <td class="main" align="right"><strong><?php echo $total['text']; ?>