Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

rosemaryann

Pioneers
  • Posts

    40
  • Joined

  • Last visited

Everything posted by rosemaryann

  1. Does anyone else have trouble with this working in Internet Explorer? I have v. 1.5.5 but it seems the ajax isn't working for some IE customers including myself on my test server. I checked in IE 8 and IE 7. It doesn't update the state field at all when you change the country. However, it works in Firefox 3.6 - haven't tried in v. 4
  2. This add on doesn't work quite properly. If the account balance is less than what is owed, the credit card is still charged $0.00. Just an FYI. I'm trying to figure out how to fix that, but I just thought I'd give a heads up to those using it.
  3. You need to run the sql queries included with the zip file on your database... ALTER TABLE `customers` ADD `customers_account_balance` DECIMAL( 15, 4 ) default '0'; DROP TABLE IF EXISTS customers_balance_history; CREATE TABLE customers_balance_history( orders_id int(11) NOT NULL, customers_id int(11) NOT NULL default '0', customers_firstname char(20) default NULL, customers_lastname char(20) default NULL, date_customers_balance datetime NOT NULL, amount_customer_balance decimal(15,4) default'0', type_customer_balance char(20) default NULL, desc_customer_balance char(64) default NULL ) TYPE=MyISAM;
  4. For those of you using Separate Pricing Per Customer & Quantity Price Breaks with Zappo's Options Types... There is a query error when customers with text attributes (if they include a comma in their text) get when they log back in. I found a fix for this and thought I would share: In /catalog/includes/classes/PriceFormatterStore.php Find... if (tep_not_null($valid_value)) { $product_id_list_array[] = $valid_value; } And replace with... if (tep_not_null($valid_value)&&is_numeric($valid_value)) { $product_id_list_array[] = $valid_value; } This way the product_id array only returns numeric values. :D Hope this helps someone else.
  5. I feel really stupid now. I actually found it, I had typed wrong in the first $products_query $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); // BOF SPPC Hide products and categories from groups $no_of_products_in_basket = 0; while ($products = tep_db_fetch_array($products_query)) { $temp_post_get_array[] = $_products['products_id']; $products[] = $_products; $no_of_products_in_basket += 1; } The while condition should be $_products NOT $products... DoH! Good grief. :blush:
  6. I don't think that this is a repeat question, I apologize if it is - there is a LOT of posts in this topic. I'm getting an error when the function tep_get_hide_status() is called (when customer logs in with 1 item in cart, and this is supposed to remove any hidden items from that cart) I am getting a query error on the $hide_query the variable $list_of_products_ids comes up blank so I get the following error: I am assuming it's causing it in the shopping_cart class file because I do have another addon (Zappos Options Types) installed. I'm going to keep looking but thought another pair of eyes might help. Can anyone see where I'm missing a variable defined? Below is the portion of code that I **THINK** is what is causing problems but I'm not really sure. $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); // BOF SPPC Hide products and categories from groups $no_of_products_in_basket = 0; while ($products = tep_db_fetch_array($products_query)) { $temp_post_get_array[] = $_products['products_id']; $products[] = $_products; $no_of_products_in_basket += 1; } if ($no_of_products_in_basket > 0) { $hide_status_products = array(); $hide_status_products = tep_get_hide_status($hide_status_products, $this->cg_id, $temp_post_get_array); for ($i=0 ; $i < $no_of_products_in_basket; $i++) { foreach($hide_status_products as $key => $subarray) { if ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '0') { // not hidden for this customer, can be added to the object shoppingCart $this->contents[$products['products_id']] = array('qty' => $products[$i]['customers_basket_quantity']); // attributes //BOF - Zappo - Option Types v2 - Update query to pull attribute value_text. This is needed for text attributes. $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products[$i]['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products[$i]['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; // - Zappo - Option Types v2 - If attribute is Text, set additional information if ($attributes['products_options_value_id'] == OPTIONS_VALUE_TEXT_ID) { $this->contents[$products[$i]['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } //EOF - Zappo - Option Types v2 - Update query to pull attribute value_text. This is needed for text attributes. } // end while } elseif ($subarray['products_id'] == tep_get_prid($products[$i]['products_id']) && $subarray['hidden'] == '1') { // product is hidden for the customer, don't add to object shoppingCart, delete from db next $products_to_delete_from_cb[] = $products[$i]['products_id']; } // end if/elseif }// end foreach ($hide_status_products as $key => $subarray) } // end for ($i=0 ; $i < $no_of_products_in_basket; $i++) // delete from the database those products that are hidden from this customer if (tep_not_null($products_to_delete_from_cb)) { $no_of_iterations = count($products_to_delete_from_cb); // since the products_id in the table customer_basket and customer_basket_attributes can contain // attributes like 1{4}2{3}6 we need to delete them one by one for the two tables for ($y = 0; $y < $no_of_iterations; $y++) { tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and (products_id = '" . (int)$products_to_delete_from_cb[$y] . "' or products_id REGEXP '^" . (int)$products_to_delete_from_cb[$y] . "{');"); tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and (products_id = '" . (int)$products_to_delete_from_cb[$y] . "' or products_id REGEXP '^" . (int)$products_to_delete_from_cb[$y] . "{');"); } // end for ($y = 0; $y < $no_of_iterations; $y++) } // end if (tep_not_null($products_to_delete_from_cb)) } // end if ($no_of_products_in_basket > 0) // EOF SPPC Hide products and categories from groups $this->cleanup(); }
  7. Hey everyone, I was wondering if anyone who has the Desktop Model up and running, do you experience the authorization request pulling the customer's account address/postcode instead of the billing address/post code? I'm getting pretty frequent transactions rejected when a customer does not enter their billing address as their main account address even if they change the billing address to their correct billing information. My QBMS module does seem to be coded right where it's requested the $order->billing['street_address'] so I'm not sure what the deal is. Anyone have this problem?
  8. Agh, nevermind. I've done something to where I have no idea what I did and no uploads work at all. Back to the drawing board. Time to revisit the original code meticulously again! Sorry
  9. Hey, hey! So I'm having an issue with file option types where if the file extension does not match, it won't display the error and it adds the product to the shopping cart without the file option if the file does not match. Where would I find the output for the error. I looked in the classes/upload.php and it's the same as the one included in the contribution. I thought it might be in the application_top where the case "add_product" was but this is identical too. Any suggestions where to look?
  10. Hey I just added a update file to the contribution, I wanted to have the option to notify a customer of an status update or not. My changes adds a Yes/No radio along with the other options that you can select to notify the customer of a status change instead of always emailing the customer for every status change. So see the contribution page for these changes: http://addons.oscommerce.com/info/3155 Cheers!
  11. Hey!, I'm sorry if I'm beeing so insistent but I really need help, if someone has the answer to my problem please tell me, help will be even more appreciated than yesterday ;) Thanks. Hey - probably you need to check and make sure you have added the file: includes/modules/option_types.php in the correct location. The other thing I would suggest is to go through /includes/classes/shopping_cart.php and make sure all the modifications are entered correctly. Though if you have another contribution(s) installed it may effect it differently.
  12. MultiMixer, Yeah I'm trying the same thing. I got similar results a little differently. PM me if you want to compare my version. My problem is that I cannot get the Text options to add to the cart. I'm thinking it's something in the classes/shopping_cart. Though it may be somewhere in the modules/option_types file. Do you have this problem as well?
  13. Hey everyone, I'm trying to combine this add-on with the Options Types 2.0 add-on. I just about have it (I think) but having a tough time with the text values being added to the shopping cart. I believe I've narrowed it down to the shopping cart class... (/includes/classes/shopping_cart.php) I was wondering if anyone has these two installed or if you can look at what I have, because I need a 2nd pair of eyes. I'm still not quite sure how the hidden attributes work in this add-on. I believe my problem is somewhere in this area: /includes/classes/shopping_cart.php // insert current cart contents in database if (is_array($this->contents)) { reset($this->contents); // BOF SPPC attribute hide/invalid check: loop through the shopping cart and check the attributes if they // are hidden for the now logged-in customer $this->cg_id = $this->get_customer_group_id(); while (list($products_id, ) = each($this->contents)) { // only check attributes if they are set for the product in the cart if (isset($this->contents[$products_id]['attributes'])) { $check_attributes_query = tep_db_query("select options_id, options_values_id, IF(find_in_set('" . $this->cg_id . "', attributes_hide_from_groups) = 0, '0', '1') as hide_attr_status from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . tep_get_prid($products_id) . "'"); while ($_check_attributes = tep_db_fetch_array($check_attributes_query)) { $check_attributes[] = $_check_attributes; } // end while ($_check_attributes = tep_db_fetch_array($check_attributes_query)) $no_of_check_attributes = count($check_attributes); $change_products_id = '0'; foreach($this->contents[$products_id]['attributes'] as $attr_option => $attr_option_value) { $valid_option = '0'; for ($x = 0; $x < $no_of_check_attributes ; $x++) { if ($attr_option == $check_attributes[$x]['options_id'] && $attr_option_value == $check_attributes[$x]['options_values_id']) { $valid_option = '1'; if ($check_attributes[$x]['hide_attr_status'] == '1') { // delete hidden attributes from array attributes, change products_id accordingly later $change_products_id = '1'; unset($this->contents[$products_id]['attributes'][$attr_option]); } } // end if ($attr_option == $check_attributes[$x]['options_id'].... } // end for ($x = 0; $x < $no_of_check_attributes ; $x++) if ($valid_option == '0') { // after having gone through the options for this product and not having found a matching one // we can conclude that apparently this is not a valid option for this product so remove it unset($this->contents[$products_id]['attributes'][$attr_option]); // change products_id accordingly later $change_products_id = '1'; } } // end foreach($this->contents[$products_id]['attributes'] as $attr_option => $attr_option_value) if ($change_products_id == '1') { $original_products_id = $products_id; $products_id = tep_get_prid($original_products_id); $products_id = tep_get_uprid($products_id, $this->contents[$original_products_id]['attributes']); // add the product without the hidden attributes to the cart $this->contents[$products_id] = $this->contents[$original_products_id]; // delete the originally added product with the hidden attributes unset($this->contents[$original_products_id]); } } // end if (isset($this->contents[$products_id]['attributes'])) } // end while (list($products_id, ) = each($this->contents)) reset($this->contents); // reset the array otherwise the cart will be emptied // EOF SPPC attribute hide/invalid check while (list($products_id, ) = each($this->contents)) { $qty = $this->contents[$products_id]['qty']; $product_query = tep_db_query("select products_id from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); if (!tep_db_num_rows($product_query)) { tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . tep_db_input($qty) . "', '" . date('Ymd') . "')"); if (isset($this->contents[$products_id]['attributes'])) { //BOF - Zappo - Option Types v2 - Update query to include attribute value && Check for Uploads from customer and copy to Upload dir $uploads_query = tep_db_query("select files_uploaded_name from " . TABLE_FILES_UPLOADED . " where sesskey = '" . tep_session_id() . "'"); while ($uploads_array = tep_db_fetch_array($uploads_query)) { if (file_exists(TMP_DIR . $uploads_array['files_uploaded_name'])) { // Customer upload found in TMP dir --> Copy to Upload Dir @rename(TMP_DIR . $uploads_array['files_uploaded_name'], UPL_DIR . $uploads_array['files_uploaded_name']); // Set Customer_ID for the files that are found tep_db_query("update " . TABLE_FILES_UPLOADED . " set customers_id = '" . (int)$customer_id . "' where sesskey = '" . tep_session_id() . "' and files_uploaded_name = '" . $uploads_array['files_uploaded_name'] . "'"); } } reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attr_value = $this->contents[$products_id]['attributes_values'][$option]; tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')"); //EOF - Zappo - Option Types v2 - Update query to include attribute value && Check for Uploads from customer and copy to Upload dir } } } else { tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . tep_db_input($qty) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); } } } // reset per-session cart contents, but not the database contents $this->reset(false); $products_query = tep_db_query("select products_id, customers_basket_quantity from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . (int)$customer_id . "'"); while ($products = tep_db_fetch_array($products_query)) { $this->contents[$products['products_id']] = array('qty' => $products['customers_basket_quantity']); // attributes //BOF - Zappo - Option Types v2 - Update query to pull attribute value_text. This is needed for text attributes. $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; // - Zappo - Option Types v2 - If attribute is Text, set additional information if ($attributes['products_options_value_id'] == OPTIONS_VALUE_TEXT_ID) { $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } //EOF - Zappo - Option Types v2 - Update query to pull attribute value_text. This is needed for text attributes. } } $this->cleanup(); }
  14. Ok so I'm having some issues with the textarea option type. I have put in 100 for it's value but only 32 characters show up in the shopping cart and consequently on the packing slip/invoice/orders.php on the admin side. I'm not sure if this is a setting I need to change somewhere or it's a setting in option types? Any suggestions? It's one of those things where I keep looking for it but just cannot see.
  15. I've gotten the module to work. We just manually enter the information in our QB file. What I'm wondering though is there a way to pull the Credit Card type, Name on Card and the Last 4 digits (the info that displays just before checkout confirmation) on the invoice on the admin side? I'd like to keep this information on file for our records since there's no way to pull payment info from the merchant services account (per QBMS Customer Service) So when we make our notes in the QB company file I'd like to have something there to reference that. Would I have to create new columns in the database and somehow pull that info? I'm bad at writing queries.... Ha! So any ideas/help would be appreciated!
  16. I eventually figured out my own question. dm me if you have this same problem. :)
  17. Ok so I installed Enforce Attribute Select and I dont' see a thread created to help with this contribution. Anyways, here's the link to the contrib: http://addons.oscommerce.com/info/3891 The problem is I know you can't run the same java command after another so I opted for the switch command BUT now I'm running into the problem if the product ID is the same as the case id's for the items in the cart, the alert for that number will pop up. I'm horrible at Java and was wondering if there was a way to define i to be solely for the option value id instead of any id # that is being added to the cart? I've kinda looked around for some Java sites but I don't know it well enough to figure this one out. Any help is appreciated!
  18. Hey, hey! Ok so I was testing out your image option on my test server and I set it to pull images by ID. Well, I have 2 image options on the same product but it doesn't seem to work. When I make selections, both images disappear and say "undefined" Is this an error or is the contrib set up this way to only allow 1 image option per product? Thank ya!
  19. Make sure you've installed all the contribution's code for both database.php and general.php Is it giving you the error when you add the option? You might want to re-check the products_attributes.php contribution additions are correct as well.
  20. Just to follow up and for anyone who may search this thread and wants to try and merge this contribution with Attributes Sets Plus I MAY have figured out - so far it looks good. I just had duplicate queries running and I think it was jacking up the frontend and the attributes it displayed. If you combine the two mods on product_info.php to look like this it should take care of the sorting problem when you have the attribute sets contribution as well. (On or around line 206 for me) : //BOF - Zappo - Option Types v2 - Add extra Option Values to Query && Placed Options in new file: option_types.php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment, popt.products_options_order from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$product_info['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_order, popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { // - Zappo - Option Types v2 - Include option_types.php - Contains all Option Types, other than the original Drowpdown... include(DIR_WS_MODULES . 'option_types.php'); if ($Default == true) { // - Zappo - Option Types v2 - Default action is (standard) dropdown list. If something is not correctly set, we should always fall back to the standard. $products_options_array = array(); // $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); // BOF Linkmatics attributes sets plus $products_options_query = tep_db_query(" SELECT pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix , pase.sort_order FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_SETS_TO_PRODUCTS . " pas2pa, " . TABLE_PRODUCTS_ATTRIBUTES_SETS . " pas, " . TABLE_PRODUCTS_ATTRIBUTES_SETS_ELEMENTS . " pase, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov WHERE pa.products_id = '" . (int)$_GET['products_id'] . "' AND pa.options_id = '" . // Zappo changed - $products_options_name['products_options_id'] . "' $ProdOpt_ID['products_options_id'] . "' AND pas2pa.products_id = pa.products_id AND pas.products_attributes_sets_id = pas2pa.products_attributes_sets_id AND pas.products_options_id = pa.options_id AND pase.products_attributes_sets_id = pas.products_attributes_sets_id AND pase.options_values_id = pa.options_values_id AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '" . $languages_id . "' ORDER BY pase.sort_order, pa.options_values_id"); // >>>>> BOF Linkmatics attributes sets plus patch v1.01 and Zappo changes if (tep_db_num_rows($products_options_query)== 0 ) { $products_options_query = tep_db_query(" SELECT pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix , pa.options_values_id FROM " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov WHERE pa.products_id = '" . (int)$_GET['products_id'] . "' AND pa.options_id = '" . $products_options_name['products_options_id'] . "' AND pov.products_options_values_id = pa.options_values_id AND pov.language_id = '" . $languages_id . "' ORDER BY pa.options_values_id"); } // <<<<< EOF Linkmatics attributes sets plus patch v1.01 // EOF Linkmatics attributes sets plus while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <!-- Zappo - Options Types - My fix for duplicate attributes showing (rr) <tr> <td class="main"><?php //echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php //echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> --> <tr> <td class="main"><?php echo $ProdOpt_Name . ':'; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $ProdOpt_ID . ']', $products_options_array, $selected_attribute) . ' ' . $ProdOpt_Comment; ?></td> </tr><?php } // End if Default=true } //EOF - Zappo - Option Types v2 - Add extra Option Values to Query && Placed Options in new file: option_types.php
  21. Thanks! Yeah it's probably somewhere conflicting. It's just strange that it varies between products what order each option's attributes are displayed in. For example on one product option1's attributes are listed like this: attribute1 attribute2 attribute3 Then on another one option1's attributes might be listed like: attribute2 attribute1 attribute3 You'd think that the sort_order would be "universal" product to product...
  22. Well so far I am loving this contribution! But I do have one problem and I wasn't sure if someone could explain why.... Now that I've installed the Option Types, my sorting order for all the items are screwed up. I had earlier installed a contrib called Attribute Sets Plus (http://addons.oscommerce.com/info/3610) but this mod rendered it useless... No problem but it seems the sorting orders I entered through that aren't sticking now with this new contribution. However, when I go back into product_attributes.php in the admin panel, I cannot change the sorting orders for the Product Attributes. So I tried to delete all the attributes and use the AJAX Manager but it doesnt' sort the attributes in the order that I add them.... In fact I can't even see a pattern for how it sorts it. Any suggestions? I want a certain option's attribute to show up first as the "default" but can't seem to get it. Another strange thing is, not all of them have changed. Thanks!
  23. I've noticed that if you ONLY have the Imprint text options they don't show up. Try adding another product option maybe and see if they show up. I'm not sure if that will fix it. The other option would to be to double check your product_info.php page b/c that's where the code for the items is.
  24. Thanks Geoffrey! Yeah actually I found that last night when I was scowering through MySQL manual. :) For anyone having this problem, it happened to me because I deleted some products that were previously on the orders.. So to fix it, I changed the following line on admin/orders.php, admin/packingslip.php and admin/invoice.php orignal line: $attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = " . $pid['products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id"); change to: $attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = " . (int)$pid['products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id");
  25. Ok now I'm getting another syntax error. 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and pta.products_text_attributes_id = ota.products_text_attributes_id' at line 1 select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = 1 and ota.products_id = and pta.products_text_attributes_id = ota.products_text_attributes_id on /catalog/admin/orders.php file. Below is a copy and paste of what I have. I tried replacing the file completely with the contributions version but it still is showing up. The weird thing is that really gets me is that my local version works fine and I'm using Firefox for browsing my local server version. But when I push it to our live web servers and check it through IE, it gives me the syntax error. It's also happening on all orders, not just ones with the Imprint text. I've made no other changes to this file except this contrib. The error is showing up also on the packingslip.php and invoice.php files in admin directory. I'm terrible with Mysql queries and syntax. So any help would be much appreciated. Any thoughts? Thanks for your help! (Full file for admin/orders.php) <?php /* $Id: orders.php 1739 2007-12-20 00:52:16Z hpdl $ osCommerce, Open Source E-Commerce Solutions 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> <td class="pageHeading" align="right"><?php echo '<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> </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> <?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>'; } } // denuz text attr // $pid = @mysql_result(tep_db_query("select products_id from products_description where products_name='" . tep_db_input($order->products[$i]['name']) . "'"), 0, "products_id"); $pid_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_model LIKE '" . tep_db_input($order->products[$i]['model']) . "'"); $pid = tep_db_fetch_array($pid_query); $attr_q = tep_db_query("select ota.*, pta.products_text_attributes_name from orders_text_attributes as ota, products_text_attributes as pta where ota.orders_id = " . $HTTP_GET_VARS['oID'] . " and ota.products_id = " . $pid['products_id'] . " and pta.products_text_attributes_id = ota.products_text_attributes_id"); while ($attr = tep_db_fetch_array($attr_q)) { echo '<br><nobr><small> <i> - ' . $attr['products_text_attributes_name'] . ': ' . stripslashes($attr['products_text_attributes_text']); echo '</i></small></nobr>'; } // eof denuz text attr 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), 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'], true) * $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_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['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> </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> <?php echo tep_hide_session_id(); ?></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> <?php echo tep_hide_session_id(); ?></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_edit.gif', IMAGE_EDIT) . '</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' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>'); $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased)); if (tep_not_null($oInfo->last_modified)) $contents[] = array('text' => TEXT_DATE_ORDER_LAST_MODIFIED . ' ' . tep_date_short($oInfo->last_modified)); $contents[] = array('text' => '<br>' . TEXT_INFO_PAYMENT_METHOD . ' ' . $oInfo->payment_method); } break; } if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) { echo ' <td width="25%" valign="top">' . "\n"; $box = new box; echo $box->infoBox($heading, $contents); echo ' </td>' . "\n"; } ?> </tr> </table></td> </tr> <?php } ?> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> <br> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
×
×
  • Create New...