Jack_mcs Posted September 8, 2011 Author Share Posted September 8, 2011 I use this in my own shops and have installed it into quite a few others and such a problem doesn't exist in any of them so I don't have any ideas as to what the problem might be. Maybe it is somethng specific to your code. You could try the included files to see if it works or not. If it does, then you've made some mistake in the installation or there is something in your code that is conflicting with this contributions code. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
parin48 Posted November 5, 2011 Share Posted November 5, 2011 Hi  i only want to add order id on the orders screen, can you explain me what all things i need to use from the package Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted November 5, 2011 Author Share Posted November 5, 2011 No, the instructions would take too much time. You'll need to figure it out yourself. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Guest Posted December 21, 2011 Share Posted December 21, 2011 Very Nice Jack - Will this work on 2.3.1 Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 21, 2011 Author Share Posted December 21, 2011 I haven't tried it but the changes are to existing files so I can't think of any reason why it won't. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 24, 2011 Author Share Posted December 24, 2011 A new version has been uploaded with the following changes: Â - Added highlight to the shipping address on the orders edit page if shipping address is different - Added number of orders and total to the customer listing page - Added files for quick install on oscommerce 2.3 - Fixed mistake in language file that caused the colors to be switched - Fixed coding mistake in finding the customers ID in orders.php Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
ggrant3 Posted April 8, 2012 Share Posted April 8, 2012 Jack, I have a sql error message but I will honest I don't know if it is related to this contribution (mainly because I don't know what the error is trying to tell me). But it only shows up on admin>order.php so that's why I wanted to check with you. Â 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 'my product name' and p.products_model = 'my product model#' at line 1 select p.products_id from products p left join products_description pd on p.products_id = pd.products_id where pd.products_name = 'my product name' and p.products_model = 'my product model#' [TEP STOP] Â Everything seems to run fine in the shop itself, but when i go to Admin>Customers>Orders I get this error message displaying above the list of orders. Â Any idea what it is signaling? Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 8, 2012 Author Share Posted April 8, 2012 Jack, I have a sql error message but I will honest I don't know if it is related to this contribution (mainly because I don't know what the error is trying to tell me). But it only shows up on admin>order.php so that's why I wanted to check with you. Â 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 'my product name' and p.products_model = 'my product model#' at line 1 select p.products_id from products p left join products_description pd on p.products_id = pd.products_id where pd.products_name = 'my product name' and p.products_model = 'my product model#' [TEP STOP] Â Everything seems to run fine in the shop itself, but when i go to Admin>Customers>Orders I get this error message displaying above the list of orders. Â Any idea what it is signaling? That doesn't look like anything to do with this contribution. It doesn't even look valid since it is saying the product model is 'my product model#'. I suggest you use the included files to test, or start over with the changes to the orders file and do them one at a time, checking after each change. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
ggrant3 Posted April 9, 2012 Share Posted April 9, 2012 That doesn't look like anything to do with this contribution. It doesn't even look valid since it is saying the product model is 'my product model#'. I suggest you use the included files to test, or start over with the changes to the orders file and do them one at a time, checking after each change. Â No, I changed the actual model # and product name because I didn't think you would know what they were. Â It just started happening after this contribution was added and I uploaded my products with Easy Populate. So I figured it was one of the two, maybe it is EP related then. Â Could you give me the sql command to "undo" the database changes that your installation sql command does? Quote Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 12, 2012 Share Posted April 12, 2012 Jack,  When I set Show Orders Highlight Address Mismatch to False, there is no change. Is this supposed to turn off the highlighting on the orders page? order summary page? or both?  Using ver 1.5, on 2.2rc2a  Great work as always. Thanks. Quote -Dave Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 13, 2012 Author Share Posted April 13, 2012 Jack,  When I set Show Orders Highlight Address Mismatch to False, there is no change. Is this supposed to turn off the highlighting on the orders page? order summary page? or both?  Using ver 1.5, on 2.2rc2a  Great work as always. Thanks. You're welcome and I appreciate the sentimate. :) That setting is meant to control the indication that the billing and shipping address do not match. But I see now I only added the check for that setting on the orders listing page. It should be on the orders edit page as well. As it is, if you have an order where the billing and shipping address don't match, there will be a message indicating that when you select that order on the orders listing page. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 13, 2012 Share Posted April 13, 2012 (edited) I changed  FIND (around line 220): <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> REPLACE WITH: <?php /*** BOF: Additional Orders Info ***/ ?> <?php $style = (BillingShippingDontMatch($oID) ? 'style="color:red; font-weight:bold"' : '' ); ?> <td class="main" <?php echo $style; ?>><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> <?php /*** EOF: Additional Orders Info ***/ ?>  TO  FIND (around line 220): <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> REPLACE WITH: <?php /*** BOF: Additional Orders Info ***/ ?> <?php $style = (BillingShippingDontMatch($oID) ? 'style="color:red; font-weight:bold"' : '' ); ?> <?php if (SHOW_ORDERS_HIGHLIGHT_ADDRESS_MISMATCH=='true') { ?> <td class="main" <?php echo $style; ?>> <?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> <?php }else{ ?> <td class="main"><?php echo tep_address_format($order->delivery['format_id'], $order->delivery, 1, '', '<br>'); ?></td> <?php } ?> <?php /*** EOF: Additional Orders Info ***/ ?>  That works I think. Edited April 13, 2012 by Roaddoctor Quote -Dave Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 13, 2012 Author Share Posted April 13, 2012 Yes, that will work. Or you can get rid of the if/else and use this line, which is what I will use in the next version <?php $style = (SHOW_ORDERS_HIGHLIGHT_ADDRESS_MISMATCH=='true' && BillingShippingDontMatch($oID) ? 'style="color:red; font-weight:bold"' : '' ); ?> Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
ggrant3 Posted May 2, 2012 Share Posted May 2, 2012 That doesn't look like anything to do with this contribution. It doesn't even look valid since it is saying the product model is 'my product model#'. I suggest you use the included files to test, or start over with the changes to the orders file and do them one at a time, checking after each change. Â Jack, Â I decided to start looking into this again to find out what's wrong. Â I uploaded everything into a stock store and I am having the same problem with a certain item (There's something about Mary, dvd). I haven't check every item in the stock store but I found the error with this one so I figured I would reach out to you to see if you can find out what is causing the problem. Â Just to refresh you on what I am experiencing: Â When I am in my admin area and I click on Customers>Orders I get a list of orders that have been placed. Â When I click on an individual order I get a brief description of the order contents. Â But when I click on some orders (at this point anything containing the "There's Something About Mary" dvd I get the following 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 's Something About Mary' and p.products_model = 'DVD-TSAB'' at line 1 select p.products_id from products p left join products_description pd on p.products_id = pd.products_id where pd.products_name = 'There's Something About Mary' and p.products_model = 'DVD-TSAB' [TEP STOP] Â This is the only item that seems to throw things out of whack, but I don't know if this error is just a visual nuisance or if it is causing other issues that I haven't noticed yet. Â By the way, I am using the included admin/orders.php file that was included with the contribution. And the sql command was run during the install. The contribution seems to function normally with the options under admin>configuration>additional info I just can't figure out why this specific stock osc item is causing this db error. Â The only thing I see that is unusual is in the error, in the first paragraph it leaves out the beginning of the title of the dvd it doesn't list [There's Something] it shows [s Something] Could it have something to do with the apostrophe in the title? Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted May 2, 2012 Author Share Posted May 2, 2012 (edited) Just to refresh you on what I am experiencing: Â When I am in my admin area and I click on Customers>Orders I get a list of orders that have been placed. In admin/includes/genreal.php,replace this line $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_prepare_input($product['name']) . "' and p.products_model = '" . tep_db_prepare_input($product['model']) . "'"); with this one $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_input($product['name']) . "' and p.products_model = '" . tep_db_input($product['model']) . "'"); Edited May 2, 2012 by Jack_mcs Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
ggrant3 Posted May 2, 2012 Share Posted May 2, 2012 In admin/includes/genreal.php,replace this line $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_prepare_input($product['name']) . "' and p.products_model = '" . tep_db_prepare_input($product['model']) . "'"); with this one $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_input($product['name']) . "' and p.products_model = '" . tep_db_input($product['model']) . "'"); Â Jack, Â I don't have a admin>includes>general.php file. I have a general.js file in there. Â You meant admin>includes>functions>general.php right? I tried the code replacement in there and it fixed it. Just want to make sure I did it in the right spot though. Quote Link to comment Share on other sites More sharing options...
ce7 Posted July 9, 2012 Share Posted July 9, 2012 No, I changed the actual model # and product name because I didn't think you would know what they were. Â It just started happening after this contribution was added and I uploaded my products with Easy Populate. So I figured it was one of the two, maybe it is EP related then. Â Could you give me the sql command to "undo" the database changes that your installation sql command does? Â Â Hi ggrant3 Â I have exactly the same problem as you have. I figure out it is not cuase by other addon as I had uninstalled it and the error still remain there. Could you please kindly share the solution how you fix the error ? Â Many thanks in advance. Â Lyn Quote Link to comment Share on other sites More sharing options...
ce7 Posted July 9, 2012 Share Posted July 9, 2012 In admin/includes/genreal.php,replace this line $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_prepare_input($product['name']) . "' and p.products_model = '" . tep_db_prepare_input($product['model']) . "'"); with this one $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_input($product['name']) . "' and p.products_model = '" . tep_db_input($product['model']) . "'"); Â Hi Jack, Â I had the exactly same problem as ggrant3. I modify the general.php with new code you provide, I got new error message as below: Â Fatal error: Call to undefined function tep_get_version() in /admin/includes/header.php on line 32 Â can you please help? Thanks in advance. Lynn Quote Link to comment Share on other sites More sharing options...
Jack_mcs Posted July 9, 2012 Author Share Posted July 9, 2012 The tep_get_version function is a core oscommerce function, not part of this contribution, so it seems you have overwritten it, or somehow deleted it, in your changes. Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 17, 2014 Share Posted April 17, 2014 (edited) @@Jack_mcs Jack - Just installed this on a new 2.3.3.4 shop. All is well with one exception.  This line, from admin\orders.php  $contents[] = array('text' => $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . sprintf(TEXT_PRODUCTS_REMAINING, GetProductsOnHand($order->products[$i])));  is causing this when you single click (select) any order that contains, for example, "A Bug's Life"  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 's Life' and p.products_model = 'DVD-ABUG'' at line 1 select p.products_id from products p left join products_description pd on p.products_id = pd.products_id where pd.products_name = 'A Bug's Life' and p.products_model = 'DVD-ABUG'  It's a single quote issue I'm pretty sure. Why would this be a problem here? I noticed a similar use of $order->products[$i]['name'] earlier in the file and there is no issue. I'm a bit confused.  If I remove the offending line all is well, so I am 99% sure I'm looking at the problem code. If I manually edit out the single quote from A Bug's Life, then all is well.  Changing the product title itself made no difference, as this is reading from TABLE_ORDERS_STATUS_HISTORY and not the product listing itself... What to do  Any ideas? Edited April 17, 2014 by Roaddoctor Quote -Dave Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 17, 2014 Author Share Posted April 17, 2014 (edited) I hadn't tried this in 2.3.3.4 but I just did and see the error you found. To fix it, in admin/includes/functions/general.php, find $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_prepare_input($product['name']) . "' and p.products_model = '" . tep_db_prepare_input($product['model']) . "'"); and replace it with $prod_query = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where pd.products_name = '" . tep_db_input($product['name']) . "' and p.products_model = '" . tep_db_input($product['model']) . "'"); Edited April 17, 2014 by Jack_mcs Roaddoctor 1 Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 17, 2014 Share Posted April 17, 2014 @@Jack_mcs  Thank you! Works great now. Quote -Dave Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 17, 2014 Share Posted April 17, 2014 @@Jack_mcs  Just noticed that  Products Ordered: 1 1 x A Bugs Life (On Hand: 6)  is broken on an order with the same single quote in the title, vs. an identical order with the ' edited out.  Products Ordered: 1 1 x A Bug's Life (On Hand: )  I'm seeing that is part of the same GetProductsOnHand function. Something more needed?  Thank you! Quote -Dave Link to comment Share on other sites More sharing options...
Jack_mcs Posted April 17, 2014 Author Share Posted April 17, 2014 I'm not seeing that here. Are you sure you made both changes to the line I mentioned? Quote Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
Roaddoctor Posted April 17, 2014 Share Posted April 17, 2014 Jack I found what was happening... During debugging at one point I had changed the product name, removing the single quote, so I assume with mismatches of NAME, somewhere in the code things get boogered. When I put the single quote back into the product title, testing with one order with single quote and one without, the behavior described above inverts, like  Products Ordered: 1 1 x A Bugs Life (On Hand: )   Products Ordered: 1 1 x A Bug's Life (On Hand: 6)  By correcting the product title to the original with single quote, and editing the single quote back into the orders, things match and work properly. So I believe things are good.  Thank you thank you Quote -Dave 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.