Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

ashneet

Archived
  • Posts

    3
  • Joined

  • Last visited

Everything posted by ashneet

  1. NEVER MIND I GOT IT FIXED ALSO DOES IT HAVE TO POP UP WHEN YOU PRESS EDIT CANT IT BE JUST IN THE SAME WINDOW. WOULD HELP IF IN STEPS HOW TO DO THAT... NOOB 2 PHP :D
  2. HERE IS THE FIRST 20+ LINES OF EACH CODE ADMIN/EDIT_ORDER.PHP <?php /* $Id: edit_orders.php,v 1.2 2003/08/08 13:50:00 jwh Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License Written by Jonathan Hilgeman of SiteCreative.com ([email protected]) Version History --------------------------------------------------------------- 16/07/04 1.56 - Added a check for missing ot_subtotal on update 08/08/03 1.2a - Fixed a query problem on osC 2.1 stores. 08/08/03 1.2 - Added more recommendations to the instructions. Added "Customer" fields for editing on osC 2.2. Corrected "Billing" fields so they update correctly. Added Company and Suburb Fields. Added optional shipping tax variable. First (and hopefully last) fix for currency formatting. 08/08/03 1.1 - Added status editing (fixed order status bug from 1.0). Added comments editing. (with compatibility for osC 2.1) Added customer notifications. Added some additional information to the instructions file. Fixed bug with product names containing single quotes. 08/07/03 1.0 - Original Release. To Do in Version 1.3 --------------------------------------------------------------- Note from the author --------------------------------------------------------------- This tool was designed and tested on osC 2.2 Milestone 2.2, but may work for other versions, as well. Most database changes were minor, so getting it to work on other versions may just need some tweaking. Hope this helps make your life easier! - Jonathan Hilgeman, August 7th, 2003 */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); include(DIR_WS_CLASSES . 'order.php'); // New "Status History" table has different format. $OldNewStatusValues = (tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "old_value") && tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "new_value")); $CommentsWithStatus = tep_field_exists(TABLE_ORDERS_STATUS_HISTORY, "comments"); $SeparateBillingFields = tep_field_exists(TABLE_ORDERS, "billing_name"); // Optional Tax Rate/Percent $AddShippingTax = "0.0"; // e.g. shipping tax of 17.5% is "17.5" $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'] : 'edit'); //UPDATE_INVENTORY_QUANTITY_START################################################# ############################################################# $order_query = tep_db_query("select products_id, products_quantity from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$oID . "'"); //UPDATE_INVENTORY_QUANTITY_START################################################# ############################################################# ORDER.PHP <?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 © 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 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, cc_cvv2 from " . TABLE_ORDERS . " where orders_id = '" . (int)$order_id . "'"); $order = tep_db_fetch_array($order_query); $totals_query = tep_db_query("select title, text 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']); } $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_expires' => $order['cc_expires'], 'cc_cvv2' => $order['cc_cvv2'], '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']); $index = 0; $orders_products_query = tep_db_query("select orders_products_id, products_name, products_model, products_price, products_tax, products_quantity, final_price from " . TABLE_ORDERS_PRODUCTS . " 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'], 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price']); $subindex = 0; $attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix 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']); $subindex++; } } $index++; } } } ?> GENERAL.PHP <?php /* $Id: general.php,v 1.160 2003/07/12 08:32:47 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ //// // Redirect to another page or site function tep_redirect($url) { global $logger; header('Location: ' . $url); if (STORE_PAGE_PARSE_TIME == 'true') { if (!is_object($logger)) $logger = new logger; $logger->timer_stop(); } exit; } //// // Parse the data used in the html tags to ensure the tags will not break function tep_parse_input_field_data($data, $parse) { return strtr(trim($data), $parse); } function tep_output_string($string, $translate = false, $protected = false) { if ($protected == true) { return htmlspecialchars($string); } else { if ($translate == false) { return tep_parse_input_field_data($string, array('"' => '"')); } else { return tep_parse_input_field_data($string, $translate); } } } function tep_output_string_protected($string) { return tep_output_string($string, false, true); } function tep_sanitize_string($string) { $string = ereg_replace(' +', ' ', $string); return preg_replace("/[<>]/", '_', $string); } function tep_customers_name($customers_id) { $customers = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customers_id . "'"); $customers_values = tep_db_fetch_array($customers); return $customers_values['customers_firstname'] . ' ' . $customers_values['customers_lastname']; } function tep_get_path($current_category_id = '') { global $cPath_array; if ($current_category_id == '') { $cPath_new = implode('_', $cPath_array); } else { if (sizeof($cPath_array) == 0) { $cPath_new = $current_category_id; } else { $cPath_new = ''; $last_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$cPath_array[(sizeof($cPath_array)-1)] . "'"); $last_category = tep_db_fetch_array($last_category_query); $current_category_query = tep_db_query("select parent_id from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $current_category = tep_db_fetch_array($current_category_query); if ($last_category['parent_id'] == $current_category['parent_id']) { for ($i = 0, $n = sizeof($cPath_array) - 1; $i < $n; $i++) { $cPath_new .= '_' . $cPath_array[$i]; } } else { for ($i = 0, $n = sizeof($cPath_array); $i < $n; $i++) { $cPath_new .= '_' . $cPath_array[$i]; } } $cPath_new .= '_' . $current_category_id; if (substr($cPath_new, 0, 1) == '_') { $cPath_new = substr($cPath_new, 1); } } } return 'cPath=' . $cPath_new; }
  3. ok i kind of like this editor but everytime i edit something ans say update i get this message. Warning: Cannot modify header information - headers already sent by (output started at /mnt/web_g/d31/s19/b021af86/www/EZsMART/nfoscomm/catalog/admin/includes/classes/order.php:146) in /mnt/web_g/d31/s19/b021af86/www/EZsMART/nfoscomm/catalog/admin/includes/functions/general.php on line 18 also i am still able to update it but dont want to recieve an error because i could get db error. plz help
×
×
  • Create New...