read()) {
if (!is_dir( $module_directory . $file)) {
if (substr($file, strrpos($file, '.')) == $file_extension) {
$directory_array[] = $file;
}
}
}
sort($directory_array);
$dir->close();
}
// For each available payment module, check if enabled
for ($i=0, $n=sizeof($directory_array); $i<$n; $i++) {
$file = $directory_array[$i];
include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/payment/' . $file);
include($module_directory . $file);
$class = substr($file, 0, strrpos($file, '.'));
if (tep_class_exists($class)) {
$module = new $class;
if ($module->check() > 0) {
// If module enabled create array of titles
$enabled_payment[] = array('id' => $module->title, 'text' => $module->title);
//if the payment method is the same as the payment module title then don't add it to dropdown menu
if ($module->title == $order->info['payment_method']) {
$paymentMatchExists='true';
}
}
}
}
//just in case the payment method found in db is not the same as the payment module title then make it part of the dropdown array or else it cannot be the selected default value
if ($paymentMatchExists !='true') {
$enabled_payment[] = array('id' => $order->info['payment_method'], 'text' => $order->info['payment_method']);
}
$enabled_payment[] = array('id' => 'Other', 'text' => 'Other');
//draw the dropdown menu for payment methods and default to the order value
echo tep_draw_pull_down_menu('update_info_payment_method', $enabled_payment, $order->info['payment_method'], 'id="update_info_payment_method" onChange="init()"');
}
else {
//draw the input field for payment methods and default to the order value
?>
delivery["state"]);
$default_tax_name = tep_get_tax_description($default_tax_class, $countryid, $zoneid);
//default tax class is set at the top of the file
echo $default_tax_name; ?>')" value="info['shipping_tax']); ?>" id="shipping_tax_rate" />
totals); $i++) {
$TotalsLengthArray[] = array("Name" => $order->totals[$i]['title']);
}
reset($TotalsLengthArray);
foreach($TotalsLengthArray as $TotalIndex => $TotalDetails) {
if (strlen($TotalDetails["Name"]) > $max_length) {
$max_length = strlen($TotalDetails["Name"]);
}
}
// END OF MAKING ALL INPUT FIELDS THE SAME LENGTH
$TotalsArray = array();
for ($i=0; $itotals); $i++) {
$TotalsArray[] = array(
"Name" => $order->totals[$i]['title'],
"Price" => number_format($order->totals[$i]['value'], 2, '.', ''),
"Class" => $order->totals[$i]['class'],
"TotalID" => $order->totals[$i]['orders_total_id']);
$TotalsArray[] = array(
"Name" => "",
"Price" => "",
"Class" => "ot_custom",
"TotalID" => "0");
}
array_pop($TotalsArray);
foreach($TotalsArray as $TotalIndex => $TotalDetails)
{
$TotalStyle = "smallText";
if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal") {
$id = $TotalDetails["Class"];//subtotal and total should each only exist once
} elseif ($TotalDetails["Class"] == "ot_tax") {
$id = preg_replace("/:$/", "", $TotalDetails["Name"]) . '-total';
} elseif ($TotalDetails["Class"] == "ot_shipping") {
$id = $TotalDetails["Class"] . $TotalIndex;
} else {
$id = $TotalDetails["Class"] . $TotalIndex;
}
if(//tax, subtotal, and total are not editable, but have all the same format
$TotalDetails["Class"] == "ot_total" ||
$TotalDetails["Class"] == "ot_subtotal" ||
$TotalDetails["Class"] == "ot_tax")
{
echo '