djmonkey1 Posted July 22, 2006 Share Posted July 22, 2006 Trying to install Order editor to better serve my customers. I think I may have installed it correctly, but due to some code modifcation for my "packing slip w/ product images" contrib, I had some confusion upon installation, and wouldn't you know it, i got an error. SOOOOOOOOOOO does anyone have better documentation on how to install this contrib, and had anyone installed this contrib while having the Packing slip w/ product images contrib? Yes, I do need both. Below is the error I got after the install, I have no idea how to correct it and I went to error located in the file... and saw nothing that said ,"hey this is the error". Maybe it was installed but needed to be configured, the documentation mentioned something about this but did not give a how-to. any help... is greatly appreciated. ok listed below is the error. Any ideas? Had an error on line 45 of admin/includes/filenames.php was referring to "define('FILENAME_TAX_RATES', 'tax_rates.php');" There is only one change to make to admin/includes/filenames.php for Order Editor and it is pretty straightforward: -------------STEP2 ------------- Open catalog/admin/includes/filenames.php Find near line:33 define('FILENAME_ORDERS', 'orders.php'); Add on a new line: define('FILENAME_ORDERS_EDIT', 'edit_orders.php'); Now, if you do something besides this it might make life a little more difficult. Changing the lines around define('FILENAME_TAX_RATES', 'tax_rates.php'); isn't part of the equation. But, if it helps, includes/filenames.php is a very picky file; every line has to be formatted in the exact same way, as in define('FILENAME_TAX_RATES', 'tax_rates.php'); Note that you have to have the opening and closing parenthesis, the comma in the middle, each of the two terms enclosed in apostrophes, and most importantly the semi-colon at the end. For instance, if on line 44 you had define('FILENAME_TAX_CLASSES', 'tax_classes.php') this would throw the following error: Parse error: parse error, unexpected T_STRING in /admin/includes/filenames.php on line 45 even though the problem actually lies on line 44. As for Packing Slip with Pictures, the only contribution I could find that fit the description you provided (in the future, please provide links when referencing other contributions in a thread like this one, it can save a lot of time), both this contribution and Order Editor modify includes/classes/order.php, Order Editor pretty heavily. Specifically, the Packing Slip mod changes the $orders_products_query by adding the products_id into the mix. For both contributions to work I would use this for the $orders_products_query and its associated array: $orders_products_query = tep_db_query(" SELECT op.orders_products_id, op.products_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.products_tax_class_id, p.products_weight FROM " . TABLE_ORDERS_PRODUCTS . " op LEFT JOIN " . TABLE_PRODUCTS . " p ON op.products_id = p.products_id WHERE orders_id = '" . (int)$order_id . "'"); while ($orders_products = tep_db_fetch_array($orders_products_query)) { $this->products[$index] = array( 'qty' => $orders_products['products_quantity'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'id' => $orders_products['products_id'], 'tax' => $orders_products['products_tax'], 'tax_description' => tep_get_tax_description($orders_products['products_tax_class_id'], $countryid, $zoneid), 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price'], 'weight' => $orders_products['products_weight'], 'orders_products_id' => $orders_products['orders_products_id']); Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
jacenstuff Posted July 27, 2006 Share Posted July 27, 2006 UGH! i'm confused. Now it's a different error. Now I have: Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/.afro/jacen/dweebweaver.com/catalog/admin/includes/classes/order.php on line 126 I look and see this(pasting the whole file), I go to the first error (on line 336) and I just simply repasted what the instructions said(minus my modded code for something else), then I get the line 126 error and have tried many different things. I know nothing about T_variable(as in what they look like so i can hunt for them and fix it); without further ado: <?php /* $Id: orders.php,v 1.112 2006/07/26 JAYMOD hpdl Exp $ USPS SHIPPING LABEL, ORDER EDITOR MOD http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $orders_statuses = array(); $orders_status_array = array(); $orders_status_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . (int)$languages_id . "'"); while ($orders_status = tep_db_fetch_array($orders_status_query)) { $orders_statuses[] = array('id' => $orders_status['orders_status_id'], 'text' => $orders_status['orders_status_name']); $orders_status_array[$orders_status['orders_status_id']] = $orders_status['orders_status_name']; } $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'update_order': $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $status = tep_db_prepare_input($HTTP_POST_VARS['status']); $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']); $order_updated = false; $check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $check_status = tep_db_fetch_array($check_status_query); if ( ($check_status['orders_status'] != $status) || tep_not_null($comments)) { tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = now() where orders_id = '" . (int)$oID . "'"); $customer_notified = '0'; if (isset($HTTP_POST_VARS['notify']) && ($HTTP_POST_VARS['notify'] == 'on')) { $notify_comments = ''; if (isset($HTTP_POST_VARS['notify_comments']) && ($HTTP_POST_VARS['notify_comments'] == 'on')) { $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n\n"; } $email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]); tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); $customer_notified = '1'; } tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', now(), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments) . "')"); $order_updated = true; } if ($order_updated == true) { $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success'); } else { $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning'); } tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=edit')); break; case 'deleteconfirm': $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); tep_remove_order($oID, $HTTP_POST_VARS['restock']); tep_redirect(tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')))); break; } } if (($action == 'edit') && isset($HTTP_GET_VARS['oID'])) { $oID = tep_db_prepare_input($HTTP_GET_VARS['oID']); $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); $order_exists = true; if (!tep_db_num_rows($orders_query)) { $order_exists = false; $messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error'); } } include(DIR_WS_CLASSES . 'order.php'); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <link rel="stylesheet" type="text/css" href="includes/stylesheet.css"> <script language="javascript" src="includes/general.js"></script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php if (($action == 'edit') && ($order_exists == true)) { $order = new order($oID); ?> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?> </td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?> </td> <!-- ORDER EDITOR MOD //--> <td class="pageHeading" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $_GET['oID']) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $_GET['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $_GET['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> '; ?></td><!-- ORDER EDITOR MOD END//--> </tr> </table></td> </tr> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="3"><?php echo tep_draw_separator(); ?></td> </tr> <tr> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" valign="top"><b><?php echo ENTRY_CUSTOMER; ?></b></td> <td class="main"><?php echo tep_address_format($order->customer['format_id'], $order->customer, 1, '', '<br>'); ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_TELEPHONE_NUMBER; ?></b></td> <td class="main"><?php echo $order->customer['telephone']; ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_EMAIL_ADDRESS; ?></b></td> <td class="main"><?php echo '<a href="mailto:' . $order->customer['email_address'] . '"><u>' . $order->customer['email_address'] . '</u></a>'; ?></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" valign="top"><b><?php echo ENTRY_SHIPPING_ADDRESS; ?></b></td> <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> </tr> </table></td> <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main" valign="top"><b><?php echo ENTRY_BILLING_ADDRESS; ?></b></td> <td class="main"><?php echo tep_address_format($order->billing['format_id'], $order->billing, 1, '', '<br>'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td> <td class="main"><?php echo $order->info['payment_method']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CUSTOMER_NOTES; ?></td> <td><i><?php //query to grab the notes $cust_notes_query = tep_db_query("select customers_id, customers_notes from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$cID . "'"); $cust_notes = tep_db_fetch_array($cust_notes_query); //end query echo $cust_notes['customers_notes']; ?></i></td> </tr> <?php if (tep_not_null($order->info['cc_type']) || tep_not_null($order->info['cc_owner']) || tep_not_null($order->info['cc_number'])) { ?> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_TYPE; ?></td> <td class="main"><?php echo $order->info['cc_type']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_OWNER; ?></td> <td class="main"><?php echo $order->info['cc_owner']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_NUMBER; ?></td> <td class="main"><?php echo $order->info['cc_number']; ?></td> </tr> <tr> <td class="main"><?php echo ENTRY_CREDIT_CARD_EXPIRES; ?></td> <td class="main"><?php echo $order->info['cc_expires']; ?></td> </tr> <?php } ?> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_EXCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRICE_INCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_EXCLUDING_TAX; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_TOTAL_INCLUDING_TAX; ?></td> </tr> <?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr class="dataTableRow">' . "\n" . ' <td class="dataTableContent" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) { for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) { echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value']; if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')'; echo '</i></small></nobr>'; } } echo ' </td>' . "\n" . ' <td class="dataTableContent" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' <td class="dataTableContent" align="right" valign="top"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n"; echo ' </tr>' . "\n"; } ?> <tr> <td align="right" colspan="8"><table border="0" cellspacing="0" cellpadding="2"> <?php for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) { echo ' <tr>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['title'] . '</td>' . "\n" . ' <td align="right" class="smallText">' . $order->totals[$i]['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td class="main"><table border="1" cellspacing="0" cellpadding="5"> <tr> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_DATE_ADDED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_CUSTOMER_NOTIFIED; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_STATUS; ?></b></td> <td class="smallText" align="center"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <?php $orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added"); if (tep_db_num_rows($orders_history_query)) { while ($orders_history = tep_db_fetch_array($orders_history_query)) { echo ' <tr>' . "\n" . ' <td class="smallText" align="center">' . tep_datetime_short($orders_history['date_added']) . '</td>' . "\n" . ' <td class="smallText" align="center">'; if ($orders_history['customer_notified'] == '1') { echo tep_image(DIR_WS_ICONS . 'tick.gif', ICON_TICK) . "</td>\n"; } else { echo tep_image(DIR_WS_ICONS . 'cross.gif', ICON_CROSS) . "</td>\n"; } echo ' <td class="smallText">' . $orders_status_array[$orders_history['orders_status_id']] . '</td>' . "\n" . ' <td class="smallText">' . nl2br(tep_db_output($orders_history['comments'])) . ' </td>' . "\n" . ' </tr>' . "\n"; } } else { echo ' <tr>' . "\n" . ' <td class="smallText" colspan="5">' . TEXT_NO_ORDER_HISTORY . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> <tr> <td class="main"><br><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '5'); ?></td> </tr> <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, tep_get_all_get_params(array('action')) . 'action=update_order'); ?> <td class="main"><?php echo tep_draw_textarea_field('comments', 'soft', '60', '5'); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td> </tr> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b><?php echo ENTRY_STATUS; ?></b> <?php echo tep_draw_pull_down_menu('status', $orders_statuses, $order->info['orders_status']); ?></td> </tr> <tr> <td class="main"><b><?php echo ENTRY_NOTIFY_CUSTOMER; ?></b> <?php echo tep_draw_checkbox_field('notify', '', true); ?></td> <td class="main"><b><?php echo ENTRY_NOTIFY_COMMENTS; ?></b> <?php echo tep_draw_checkbox_field('notify_comments', '', true); ?></td> </tr> </table></td> <td valign="top"><?php echo tep_image_submit('button_update.gif', IMAGE_UPDATE); ?></td> </tr> </table></td> </form></tr> <tr> <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_EDIT, 'oID=' . $_GET['oID']) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $_GET['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $_GET['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . /* MOD for USPS */'</a><a href="' . tep_href_link(FILENAME_ORDERS_DIFFERENTSHIPPING, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_labelshipping.gif', IMAGE_ORDERS_DIFFERENTSHIPPING) . /*END OF USPS MOD*/ '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> '; ?></td> </tr> <?php } else { ?> <tr> <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td> <td align="right"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><?php echo tep_draw_form('orders', FILENAME_ORDERS, '', 'get'); ?> <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('oID', '', 'size="12"') . tep_draw_hidden_field('action', 'edit'); ?></td> </form></tr> <tr><?php echo tep_draw_form('status', FILENAME_ORDERS, '', 'get'); ?> <td class="smallText" align="right"><?php echo HEADING_TITLE_STATUS . ' ' . tep_draw_pull_down_menu('status', array_merge(array(array('id' => '', 'text' => TEXT_ALL_ORDERS)), $orders_statuses), '', 'onChange="this.form.submit();"'); ?></td> </form></tr> </table></td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CUSTOMERS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ORDER_TOTAL; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_DATE_PURCHASED; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td> <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td> </tr> <?php if (isset($HTTP_GET_VARS['cID'])) { $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']); $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC"; } elseif (isset($HTTP_GET_VARS['status']) && is_numeric($HTTP_GET_VARS['status']) && ($HTTP_GET_VARS['status'] > 0)) { $status = tep_db_prepare_input($HTTP_GET_VARS['status']); $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } else { $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC"; } $orders_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $orders_query_raw, $orders_query_numrows); $orders_query = tep_db_query($orders_query_raw); while ($orders = tep_db_fetch_array($orders_query)) { if ((!isset($HTTP_GET_VARS['oID']) || (isset($HTTP_GET_VARS['oID']) && ($HTTP_GET_VARS['oID'] == $orders['orders_id']))) && !isset($oInfo)) { $oInfo = new objectInfo($orders); } if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n"; } else { echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n"; } ?> <td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $orders['orders_id'] . '&action=edit') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a> ' . $orders['customers_name']; ?></td> <td class="dataTableContent" align="right"><?php echo strip_tags($orders['order_total']); ?></td> <td class="dataTableContent" align="center"><?php echo tep_datetime_short($orders['date_purchased']); ?></td> <td class="dataTableContent" align="right"><?php echo $orders['orders_status_name']; ?></td> <td class="dataTableContent" align="right"><?php if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td> </tr> <?php } ?> <tr> <td colspan="5"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $orders_split->display_count($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_ORDERS); ?></td> <td class="smallText" align="right"><?php echo $orders_split->display_links($orders_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'oID', 'action'))); ?></td> </tr> </table></td> </tr> </table></td> <?php $heading = array(); $contents = array(); switch ($action) { case 'delete': $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ORDER . '</b>'); $contents = array('form' => tep_draw_form('orders', FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=deleteconfirm')); $contents[] = array('text' => TEXT_INFO_DELETE_INTRO . '<br><br><b>' . $cInfo->customers_firstname . ' ' . $cInfo->customers_lastname . '</b>'); $contents[] = array('text' => '<br>' . tep_draw_checkbox_field('restock') . ' ' . TEXT_INFO_RESTOCK_PRODUCT_QUANTITY); $contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'); break; default: if (isset($oInfo) && is_object($oInfo)) { $heading[] = array('text' => '<b>[' . $oInfo->orders_id . '] ' . tep_datetime_short($oInfo->date_purchased) . '</b>'); $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_details.gif', IMAGE_DETAILS) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>'); $contents[] = array('align' => 'cente Quote We must be the change we wish to see in the world. ------------------------------------------------------------ p.s. BACKUP! Link to comment Share on other sites More sharing options...
jacenstuff Posted July 27, 2006 Share Posted July 27, 2006 Sorry to bother yall, But I have figured out the problem :) Not really sure how I did, but the problem was NOT in the file I ahd mentioned earlier but in admin/includes/classes/order.php I thought that maybe since everything looked right it must be looking for information from another file. Then I thought the only thing I did different was just cut and paste the help from djmonkey. But apprently I think there may have been a typo mr. djmonkey... cuz it was acting all narsty, but taken what you have told and taught me I went in there myself and hunted around and got to keep both contribs and both are working great. Thanks so much for this mod, and for mr. djmonkey! Quote We must be the change we wish to see in the world. ------------------------------------------------------------ p.s. BACKUP! Link to comment Share on other sites More sharing options...
kbking Posted July 27, 2006 Share Posted July 27, 2006 Hi! I installed Order Editor 2.1 (3/21/2006) a few month ago. Now I would like to upgrade to the latest 2.6 version. I have SPPC, Quantity Price Breaks for SPPC, Hide products from customer groups for SPPC and some other contributions already in the code. I'm not sure on how to do this upgrade. For example in the install instruction it says: ------------- STEP3 ------------- Open catalog/admin/includes/classes/order.php Find the $order_query near line:27 $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, currency, currency_value, date_purchased, orders_status, last_modified from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); Replace with: $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); This makes me unsure on what to do. The code block looks like this in my catalog/admin/includes/classes/order.php: // BOF add SPPC customers_group_name to the info $order_query = tep_db_query("select customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, o.customers_telephone, o.customers_email_address, customers_address_format_id, customers_group_name, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_cvv2, cc_expires, currency, currency_value, date_purchased, orders_status, ipaddy, ipisp, last_modified from " . TABLE_ORDERS . " o left join " . TABLE_CUSTOMERS . " using(customers_id) left join " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) where orders_id = '" . (int)$order_id . "'"); // EOF add SPPC customer_group_name to the info Since I can't interprete the code due to lack of sufficient php-knowledge, I wonder if the code can be replaced like that, with reference to to the SPPC code in there? So basically I would appreciate a bit more guidance on how to do the upgrade (other than what is in the instructions). TIA /kbking Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 27, 2006 Share Posted July 27, 2006 Hi! I installed Order Editor 2.1 (3/21/2006) a few month ago. Now I would like to upgrade to the latest 2.6 version. I have SPPC, Quantity Price Breaks for SPPC, Hide products from customer groups for SPPC and some other contributions already in the code. I'm not sure on how to do this upgrade. For example in the install instruction it says: This makes me unsure on what to do. The code block looks like this in my catalog/admin/includes/classes/order.php: Since I can't interprete the code due to lack of sufficient php-knowledge, I wonder if the code can be replaced like that, with reference to to the SPPC code in there? So basically I would appreciate a bit more guidance on how to do the upgrade (other than what is in the instructions). TIA /kbking Try // BOF add SPPC customers_group_name to the info $order_query = tep_db_query(" SELECT * from " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_CUSTOMERS . " using(customers_id) LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) WHERE orders_id = '" . (int)$order_id . "'"); // EOF add SPPC customer_group_name to the info and see how that goes. I'm not familiar with that particular style of MySQL syntax. What add-on for SPPC had you modify the admin/includes/classes/order.php file? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
kbking Posted July 27, 2006 Share Posted July 27, 2006 Try // BOF add SPPC customers_group_name to the info $order_query = tep_db_query(" SELECT * from " . TABLE_ORDERS . " o LEFT JOIN " . TABLE_CUSTOMERS . " using(customers_id) LEFT JOIN " . TABLE_CUSTOMERS_GROUPS . " using(customers_group_id) WHERE orders_id = '" . (int)$order_id . "'"); // EOF add SPPC customer_group_name to the info and see how that goes. I'm not familiar with that particular style of MySQL syntax. What add-on for SPPC had you modify the admin/includes/classes/order.php file? Thanks! Strange! I've searched the forums here and in my own files to find the purpose of this alteration, but couldn't find anything. It's quite a while ago I did this and my memory doesn't serves me here. Which is better do you think, go with your suggestion above or stick to the instructions and replace the whole block (then assuming I've altered the wrong file) with: $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); Quote Link to comment Share on other sites More sharing options...
chameleon Posted July 27, 2006 Share Posted July 27, 2006 I don get my netto amount (Netto-Betrag) working :-( thats the first screenshot after refresh it adds my netto amount (Netto-Betrag) to the subtotal, so the sum is nearly double anyone here who can help? If needed i will post my /module/ot_netto.php I use the lates version of edit_orders 2.6.1 Quote Link to comment Share on other sites More sharing options...
kbking Posted July 27, 2006 Share Posted July 27, 2006 Which is better do you think, go with your suggestion above or stick to the instructions and replace the whole block (then assuming I've altered the wrong file) with: $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); I tried both. When following the install instructions the Customers -> Orders orders.php-page took at least 5 seconds to load while when using your suggestion it loaded instantly. Now, everything on Details page and edit_orders.php page looks good, but when trying to add a product or update, edit_orders.php throws this in my face: 1054 - Unknown column 'shipping_tax' in 'field list'. Therefor I run this command on the database: ALTER TABLE orders ADD shipping_tax DECIMAL( 7, 4 ) DEFAULT '25.000' NOT NULL; INSERT into configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) values ('', 'Order Editor- Display Payment Method dropdown?', 'DISPLAY_PAYMENT_METHOD_DROPDOWN', 'true', 'Display Payment Method in Order Editor as dropdown menu (true) or as input field (false)', '1', '21', NULL, '2006-04-02 11:51:01', NULL, 'tep_cfg_select_option(array(\'true\', \'false\'),'); Now the edit_orders.php page only loads down to 2. Payment Method. on edit_orders.php page, from there and downwards nothing is visible. Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 27, 2006 Share Posted July 27, 2006 I tried both. When following the install instructions the Customers -> Orders orders.php-page took at least 5 seconds to load while when using your suggestion it loaded instantly. Now, everything on Details page and edit_orders.php page looks good, but when trying to add a product or update, edit_orders.php throws this in my face: 1054 - Unknown column 'shipping_tax' in 'field list'. Therefor I run this command on the database: Now the edit_orders.php page only loads down to 2. Payment Method. on edit_orders.php page, from there and downwards nothing is visible. Try this- backup your working copy of admin/includes/classes/order.php and in its place upload the version that is in the Order Editor zip package. See how things work then. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 27, 2006 Share Posted July 27, 2006 I don get my netto amount (Netto-Betrag) working :-( thats the first screenshot after refresh it adds my netto amount (Netto-Betrag) to the subtotal, so the sum is nearly double anyone here who can help? If needed i will post my /module/ot_netto.php I use the lates version of edit_orders 2.6.1 What is the class value of the netto amount as stored in the orders_total table? For instance subtotal is ot_subtotal, total is ot_total, etc. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
kbking Posted July 28, 2006 Share Posted July 28, 2006 Try this- backup your working copy of admin/includes/classes/order.php and in its place upload the version that is in the Order Editor zip package. See how things work then. Did that and it makes no difference. When "Order Editor- Display Payment Method dropdown?" in Configuration is set to false the whole edit_orders.php becomes visible. Also, I noticed that in section 4. Discount, Freight and Total, the Shipping Tax inputfield shows four decimal places, 0,0000, and the other inputfields has two, 0,00. If I put the curser in the blank inputfield just above the grey Total-field the Total and SubTotal changes from 706.00 and 540.00 to 700.0000 and 540.0000. Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 28, 2006 Share Posted July 28, 2006 Did that and it makes no difference. When "Order Editor- Display Payment Method dropdown?" in Configuration is set to false the whole edit_orders.php becomes visible. Something is interfering with the payment method dropdown. It doesn't play well with all payment modules. Also, I noticed that in section 4. Discount, Freight and Total, the Shipping Tax inputfield shows four decimal places, 0,0000, and the other inputfields has two, 0,00. You have Tax Decimal Places set to "4". If I put the curser in the blank inputfield just above the grey Total-field the Total and SubTotal changes from 706.00 and 540.00 to 700.0000 and 540.0000. That's how it works- the JavaScript displays to four decimal places when it does calculations. You can change that if it really bothers you. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
chameleon Posted July 31, 2006 Share Posted July 31, 2006 What is the class value of the netto amount as stored in the orders_total table? For instance subtotal is ot_subtotal, total is ot_total, etc. The Netto-amount ist stored with ot_netto in table orders_total Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted July 31, 2006 Share Posted July 31, 2006 If I put the curser in the blank inputfield just above the grey Total-field the Total and SubTotal changes from 706.00 and 540.00 to 700.0000 and 540.0000. There is a bug in the JavaScript that handles the computation of taxes and the final total. In admin/edit_orders.php at about line 943 find function getTaxTotals(action, taxdescription){ //find the right place to put the tax totals var sum =0; var el=document.getElementsByTagName('input');//all the input elements for(var i=0;i<el.length;i++){ if (action == 'tax'){ if(el[i].id.indexOf(taxdescription)>-1){ var p=el[i].id.replace(taxdescription,'').replace(/\d/g,''); //defaultTaxName=replace(defaultTaxName,'').replace(/\d/g,'');//strip numbers from defaultTaxName because function strips numbers from the id if(p=='p'){ sum+=Number(el[i].value); }//end p = p //shipping tax is added to the default tax class if ((p == 'ot_shipping') || (p == defaultTaxName + 'ot_shipping')) { var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value; <?php if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>//shipping tax is part of the shipping charge sum += Number(el[i].value) * taxRate / (Number(taxRate) + 100); <?php } else { ?>//shipping tax is in addition to the shipping charge sum += Number(el[i].value) * taxRate / 100; <?php } ?> }//end if p == ot_shipping }//end if taxdescription >-1 }//end if action = tax } //end for(var i=0;i<el.length;i++){ return sum } //end function getTaxTotals and change it to function getTaxTotals(action, taxdescription){ //find the right place to put the tax totals var sum =0; var taxRate = document.getElementById("shipping_tax_rate").value; var el=document.getElementsByTagName('input');//all the input elements for(var i=0;i<el.length;i++){ var p=el[i].id.replace(taxdescription,'').replace(/\d/g,''); if(p=='p'){ sum+=Number(el[i].value); }//end p = p //shipping tax is added to the default tax class if (p == 'ot_shipping') { <?php if (DISPLAY_PRICE_WITH_TAX == 'true') { ?>//shipping tax is part of the shipping charge sum += Number(el[i].value) * taxRate / (Number(taxRate) + 100); <?php } else { ?>//shipping tax is in addition to the shipping charge sum += Number(el[i].value) * taxRate / 100; <?php } ?> }//end if p == ot_shipping } //end for(var i=0;i<el.length;i++){ return sum } //end function getTaxTotals At line 999 find if ((pid == 'ot_custom') || (pid == defaultTaxName + 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee')) { and change it to if ((pid == 'ot_custom') || (pid == 'ot_shipping') || (pid == 'p-total_incl') || (pid == 'ot_loworderfee')) { At line 1008 find if (pid == defaultTaxName + 'ot_shipping') { var taxRate = document.getElementById("shipping_tax-" + defaultTaxName).value; and change it to if (pid == 'ot_shipping') { var taxRate = document.getElementById("shipping_tax_rate").value; At line 1523 find echo $default_tax_name; ?>')" value="<?php echo tep_display_tax_value($order->info['shipping_tax']); ?>" id="shipping_tax-<?php echo $default_tax_name; ?>" /></td> and change it to echo $default_tax_name; ?>')" value="<?php echo tep_display_tax_value($order->info['shipping_tax']); ?>" id="shipping_tax_rate" /></td> At line 1573 find $id = $default_tax_name . $TotalDetails["Class"] . $TotalIndex; and change it to $id = $TotalDetails["Class"] . $TotalIndex; The JavaScript should be able to handle things after this. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
vvhorus Posted August 1, 2006 Share Posted August 1, 2006 Hi! I have a question: On my site, I installed the Encrypting Credit Card via php:mcrypt() contribution a few weeks ago, which is working fine. Now, after I installed the order editor, I get this error message when I try to edit an order: Fatal error: Call to undefined function: cc_decrypt() in /home/~mydomain~/admin/includes/classes/order.php on line 35 Here's my order.php file: <?php /* $Id: order.php,v 1.7 2003/06/20 16:23:08 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class order { var $info, $totals, $products, $customer, $delivery; function order($order_id) { $this->info = array(); $this->totals = array(); $this->products = array(); $this->customer = array(); $this->delivery = array(); $this->query($order_id); } function query($order_id) { $order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $order = tep_db_fetch_array($order_query); // See if we need to decrypt - if it's already been zapped or deleted then no decrypt $cc_number_decrypt = $order['cc_number']; if(tep_not_null($cc_number_decrypt)) { if(strncmp("xxxxxxxxxxxx", $cc_number_decrypt, 12)) { $cc_number_decrypt = cc_decrypt(base64_decode($order['cc_number']), CCKEY); } } else { $cc_number_decrypt = ''; } $totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$order_id . "' order by sort_order"); while ($totals = tep_db_fetch_array($totals_query)) { $this->totals[] = array( 'title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'sort_order' => $totals['sort_order'], 'orders_total_id' => $totals['orders_total_id']); } $this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], // 'cc_number' => $order['cc_number'], 'cc_number' => $cc_number_decrypt, 'cc_expires' => $order['cc_expires'], 'shipping_tax' => $order['shipping_tax'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified']); $this->customer = array('name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']); $this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'suburb' => $order['delivery_suburb'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => $order['delivery_country'], 'format_id' => $order['delivery_address_format_id']); $this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'suburb' => $order['billing_suburb'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => $order['billing_country'], 'format_id' => $order['billing_address_format_id']); $countryid = tep_get_country_id($this->delivery["country"]); $zoneid = tep_get_zone_id($countryid, $this->delivery["state"]); $index = 0; $orders_products_query = tep_db_query(" SELECT op.orders_products_id, op.products_name, op.products_model, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.products_tax_class_id, p.products_weight FROM " . TABLE_ORDERS_PRODUCTS . " op LEFT JOIN " . TABLE_PRODUCTS . " p ON op.products_id = p.products_id WHERE orders_id = '" . (int)$order_id . "'"); while ($orders_products = tep_db_fetch_array($orders_products_query)) { $this->products[$index] = array('qty' => $orders_products['products_quantity'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'tax' => $orders_products['products_tax'], 'tax_description' => tep_get_tax_description($orders_products['products_tax_class_id'], $countryid, $zoneid), 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price'], 'weight' => $orders_products['products_weight'], 'orders_products_id' => $orders_products['orders_products_id']); $subindex = 0; $attributes_query = tep_db_query("select * from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$order_id . "' and orders_products_id = '" . (int)$orders_products['orders_products_id'] . "'"); if (tep_db_num_rows($attributes_query)) { while ($attributes = tep_db_fetch_array($attributes_query)) { $this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price'], 'orders_products_attributes_id' => $attributes['orders_products_attributes_id']); $subindex++; } } $index++; } } } ?> I've had pretty good success customizing my site, but I'm no php coder, so any help would be appreciated. Thanks! Quote Link to comment Share on other sites More sharing options...
vvhorus Posted August 1, 2006 Share Posted August 1, 2006 Hi: Never mind my last post. I figured it out. :D In case someone else has this same issue, here's what I did. In your edit_orders.php file around line 17: find this: require('includes/application_top.php'); add this line of code below that: require(DIR_WS_FUNCTIONS . 'cc_crypt.php'); Thanks for an excellent contribution! Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted August 2, 2006 Share Posted August 2, 2006 The Netto-amount ist stored with ot_netto in table orders_total ***These instructions are written for v2.6.1 and v2.6.2*** ### older versions are probably compatible ### Find this at about line 136: $RunningSubTotal = 0; $RunningTax = array($default_tax_name => 0); and change it to: $RunningSubTotal = 0; $RunningNetto = 0; $RunningTax = array($default_tax_name => 0); then find at about line 230 //update subtotal and total during update function if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); } else { $RunningSubTotal += $products_details["qty"] * $products_details["final_price"]; } and change it to //update subtotal and total during update function //this modification assumes you have Display Price with Tax set to 'true' //if you don't have Display Price with Tax set to 'true' this won't work so good $RunningSubTotal += (($products_details['tax']/100 + 1) * ($products_details['qty'] * $products_details['final_price'])); $RunningNetto += $products_details["qty"] * $products_details["final_price"]; Then find at about line 362 if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } and change it to if ($ot_class == "ot_subtotal") { $ot_value = $RunningSubTotal; } if ($ot_class == "ot_netto") { $ot_value = $RunningNetto; } if ($ot_class == "ot_tax") { $ot_value = $RunningTax[preg_replace("/:$/","",$ot_title)]; } Find at line 409 if ($ot_class == "ot_tax") { if (DISPLAY_PRICE_WITH_TAX != 'true') { //we don't add tax to the total here because it's already added to the subtotal $RunningTotal += $ot_value; } } else { $RunningTotal += $ot_value; } and change it to if ($ot_class == "ot_tax") { if (DISPLAY_PRICE_WITH_TAX != 'true') { //we don't add tax to the total here because it's already added to the subtotal $RunningTotal += $ot_value; } } elseif ($ot_class != "ot_netto") { $RunningTotal += $ot_value; } Find at line 418 if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total")) { // value = 0 => Delete Total Piece and change it to if (!trim($ot_value) && ($ot_class != "ot_shipping") && ($ot_class != "ot_subtotal") && ($ot_class != "ot_total") && ($ot_class != "ot_netto")) { // value = 0 => Delete Total Piece Find at about line 558 // 2.2.2 Calculate Tax and Sub-Totals $order = new order($oID); $RunningSubTotal = 0; $RunningTax = array($default_tax_name => 0); and change it to // 2.2.2 Calculate Tax and Sub-Totals $order = new order($oID); $RunningSubTotal = 0; $RunningNetto = 0; $RunningTax = array($default_tax_name => 0); Find at about line 585 // This calculatiion of Subtotal and Tax is part of the 'add a product' process if (DISPLAY_PRICE_WITH_TAX == 'true') { $RunningSubTotal += (($order->products[$i]['tax'] / 100 + 1) * ($order->products[$i]['qty'] * $order->products[$i]['final_price'])); } else { $RunningSubTotal += ($order->products[$i]['qty'] * $order->products[$i]['final_price']); } and change it to // This calculatiion of Subtotal and Tax is part of the 'add a product' process //this modification assumes you have Display Price with Tax set to 'true' //if the truth is otherwise seek better counsel $RunningSubTotal += (($order->products[$i]['tax'] / 100 + 1) * ($order->products[$i]['qty'] * $order->products[$i]['final_price'])); $RunningNetto += ($order->products[$i]['qty'] * $order->products[$i]['final_price']); Find this at about line 618 // 2.2.2.3 Total if (DISPLAY_PRICE_WITH_TAX == 'true') { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_tax" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } else { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } and change it to // 2.2.2.2.1 ot_netto $Query = 'UPDATE ' . TABLE_ORDERS_TOTAL . ' SET text = "' . $currencies->format($RunningNetto, true, $order->info['currency'], $order->info['currency_value']) . '", value = "' . $RunningNetto . '" WHERE class="ot_netto" AND orders_id= "' . (int)$oID . '"'; tep_db_query($Query); // 2.2.2.3 Total if (DISPLAY_PRICE_WITH_TAX == 'true') { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_netto" AND class != "ot_tax" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } else { $Query = 'SELECT sum(value) AS total_value from ' . TABLE_ORDERS_TOTAL . ' WHERE class != "ot_total" AND class != "ot_netto" AND orders_id= "' . (int)$oID . '"'; $result = tep_db_query($Query); $row = tep_db_fetch_array($result); $Total = $row['total_value']; } Find at about line 1562 if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal") { $id = $TotalDetails["Class"];//subtotal and total should each only exist once and change it to if ($TotalDetails["Class"] == "ot_total" || $TotalDetails["Class"] == "ot_subtotal" || $TotalDetails["Class"] == "ot_netto") { $id = $TotalDetails["Class"];//subtotal and total should each only exist once Find at line 1576 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") and change it to 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_netto" || $TotalDetails["Class"] == "ot_tax") This should be everything but the JavaScript. Let me know how this goes- once we get the PHP to work we can worry about the bells and whistles. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
chameleon Posted August 2, 2006 Share Posted August 2, 2006 ***These instructions are written for v2.6.1 and v2.6.2*** Thx for your answer...you are fast and great I use v2.6.2 the site works and it looks like the java script is working correct too. only one problem, the tax and the netto-amount is now calculatet not correct here the screen shots the red nummbers it is what it must be the shipping cost (pauschaleversandkosten 5,00 includes 0,69 tax Quote Link to comment Share on other sites More sharing options...
concorde44 Posted August 2, 2006 Share Posted August 2, 2006 Hi everybody! I just installed the new order editor v2.6.2 over an old 1.75 version! Changes ok. I have a curious tax problem only when adding a product in order editor : before when only seeing an order with order editor : everythings fine . subtotal = subtotal of taxed products amount. But after adding one product, the subtotal = subtotal of non taxed products! So the total is missing the VAT . Can you help ? I have only one tax. thanks! Seb Quote Osc 2.2 MS2 Link to comment Share on other sites More sharing options...
djmonkey1 Posted August 2, 2006 Share Posted August 2, 2006 Thx for your answer...you are fast and greatI use v2.6.2 the site works and it looks like the java script is working correct too. only one problem, the tax and the netto-amount is now calculatet not correct here the screen shots the red nummbers it is what it must be the shipping cost (pauschaleversandkosten 5,00 includes 0,69 tax For the shipping tax, you have to manually enter the shipping tax rate into the "Shipping tax" field. Do this and see how the numbers come out then. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
djmonkey1 Posted August 2, 2006 Share Posted August 2, 2006 Hi everybody!I just installed the new order editor v2.6.2 over an old 1.75 version! Changes ok. I have a curious tax problem only when adding a product in order editor : before when only seeing an order with order editor : everythings fine . subtotal = subtotal of taxed products amount. But after adding one product, the subtotal = subtotal of non taxed products! So the total is missing the VAT . Can you help ? I have only one tax. thanks! Seb Did you get all the changes to admin/includes/classes/order.php? Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Pilly Posted August 2, 2006 Share Posted August 2, 2006 (edited) Just a question, i use individual shipping prices contrib. When I add a product to the order how do i automatically get the shipping price added to the total?? on v.2.6.2 Also even though i dont use it, if i type something into the shipping tax total field, it doesnt update the subtotal or total fields? Edited August 2, 2006 by Pilly Quote Link to comment Share on other sites More sharing options...
Scotty1 Posted August 2, 2006 Share Posted August 2, 2006 I am a great fan of Order editor and have been using it since version 1.75 without any issues. Recently I upgraded from version 2.2.1 to version 2.5 and noticed that the stock level stopped being updated. I patiently waited for the next rollup to see if this would fix the problem 2.6.2 and have diligently install this but the issue still exists. Has anyone any idea what I should be looking for or how I might fix this problem? Quote Scott Lawry Link to comment Share on other sites More sharing options...
chameleon Posted August 2, 2006 Share Posted August 2, 2006 For the shipping tax, you have to manually enter the shipping tax rate into the "Shipping tax" field. Do this and see how the numbers come out then. thx the tax is calculated correct but the netto-amount is not correct the netto-amount must be the subtotal without all tax Quote Link to comment Share on other sites More sharing options...
djmonkey1 Posted August 2, 2006 Share Posted August 2, 2006 Just a question, i use individual shipping prices contrib. When I add a product to the order how do i automatically get the shipping price added to the total?? on v.2.6.2 Unless you can develop a way to call the shipping module(s) through Order Editor, at this point you have to compute the shipping charges manually. Also even though i dont use it, if i type something into the shipping tax total field, it doesnt update the subtotal or total fields? There has to be a tax field for it to be calculated into. If the PHP didn't generate a field for that tax class there won't be anywhere for the JavaScript to put the tax total; the JavaScript can't create fields as it goes (not a bad idea but I'm still new to Ajax). Try entering something in the box and then push "update" and see how it works then. Quote Do, or do not. There is no try. Order Editor 5.0.6 "Ultra Violet" is now available! For support or to post comments, suggestions, etc, please visit the Order Editor support thread. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.