Guest Posted February 23, 2007 Posted February 23, 2007 Hi all, I've searched the forums and can't seem to find an answer to my problem. When I created my OSC site, I added a field into the products table called product number because we have a separate set of numbers we use for office use rather than the OSC numbers listed online. I want to be able to insert this value into the email that our customers and office staff receive when an order is placed. My first problem is I can't seem to find the file that generates this email. Does this sound like something that would be relatively easy to do?
davidinottawa Posted February 24, 2007 Posted February 24, 2007 Hi all, I've searched the forums and can't seem to find an answer to my problem. When I created my OSC site, I added a field into the products table called product number because we have a separate set of numbers we use for office use rather than the OSC numbers listed online. I want to be able to insert this value into the email that our customers and office staff receive when an order is placed. My first problem is I can't seem to find the file that generates this email. Does this sound like something that would be relatively easy to do? Hey Brian - you *only* want it added to the emails ? what about the orders listing, invoice, packing slip ?
davidinottawa Posted February 24, 2007 Posted February 24, 2007 Hey Brian - you *only* want it added to the emails ? what about the orders listing, invoice, packing slip ? I wrote this last week for a guy that had a new field in his products table called expiry_date : http://www.oscommerce.com/forums/index.php?s=&...t&p=1028378 I'm sure you can easily follow this to accommodate your new column for your in-house product number. david
Guest Posted February 26, 2007 Posted February 26, 2007 david, Thanks a ton for your reply. I was able to follow your guide and make the necessary modifications. The invoice and packing slip part work great (and yes, I was also needing that, just didn't think of it :)) But, I'm having an issue with the last section which deals with the email. It appears that my version of OSC (2.2-MS2) is a bit different than what you originally wrote the modification code for. When I try to find the line $order_size = sizeof($order->products); for ($i=0; $i<$order_size; $i++) { it can't be found in checkout_process.php The only lines close to this are: for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => $insert_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // Stock Update - Joao Correia if (STOCK_LIMITED == 'true') { if (DOWNLOAD_ENABLED == 'true') { $stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON p.products_id=pa.products_id LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad ON pa.products_attributes_id=pad.products_attributes_id WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"; for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) { if (DOWNLOAD_ENABLED == 'true') { $attributes_query = "select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix, pad.products_attributes_maxdays, pad.products_attributes_maxcount , pad.products_attributes_filename from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad on pa.products_attributes_id=pad.products_attributes_id where pa.products_id = '" . $order->products[$i]['id'] . "' and pa.options_id = '" . $order->products[$i]['attributes'][$j]['option_id'] . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . $order->products[$i]['attributes'][$j]['value_id'] . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . $languages_id . "' and poval.language_id = '" . $languages_id . "'"; $attributes = tep_db_query($attributes_query); } else { for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n"; } Does the code after any of the for statements above look correct? If I had to venture a guess I'd think it was the first code strip, but since this is a live site I'm hesitant to play around with it too much without knowing exactly what it will do. Thanks again for your help.
davidinottawa Posted February 26, 2007 Posted February 26, 2007 david,Thanks a ton for your reply. I was able to follow your guide and make the necessary modifications. The invoice and packing slip part work great (and yes, I was also needing that, just didn't think of it :)) But, I'm having an issue with the last section which deals with the email. It appears that my version of OSC (2.2-MS2) is a bit different than what you originally wrote the modification code for. When I try to find the line $order_size = sizeof($order->products); for ($i=0; $i<$order_size; $i++) { it can't be found in checkout_process.php Hi Brian - I'm pretty sure it's this one in your installation : for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { // stock update I guess I don't need to give you the "why the heck are you working with live data" speech do I!? lol. :-) It's SOOOOOOOOOOOOOO fast and easy to create a test site - there's no excuse to be working on live data/site imho. The problem I have seen time and time and time again - is that the client makes a wack of changes, breaks the site, and is unable to undo what they have done. Create a test site and test database - seriously. :-) You can just post your checkout_process file here if you like. I'll send you a PM as well. david
Guest Posted February 28, 2007 Posted February 28, 2007 david, That worked like a charm. (And yes, I did create a test site just to be safe :)) Thanks for your help!
Guest Posted February 28, 2007 Posted February 28, 2007 Also a note on the test site - I placed it on the same host as our live site. Once I get somethings finalized a bit better I plan to re-submit our site to the search engines so that the search engine links will be updated (and will hopefully increase our ranking) My question is, won't the spiders also index the test site? Is there a way to exclude that directory? Thanks again.
davidinottawa Posted February 28, 2007 Posted February 28, 2007 Also a note on the test site - I placed it on the same host as our live site. Once I get somethings finalized a bit better I plan to re-submit our site to the search engines so that the search engine links will be updated (and will hopefully increase our ranking)My question is, won't the spiders also index the test site? Is there a way to exclude that directory? Thanks again. Hi Brian - 1) Why do you want to re-submit your site ? I would not recommend this practice - and it is highly unliekly it would do anything anyway. Re-submitting your site does not get you updated - the search engine spider reading your content gets you updated. http://www.google.com/webmasters/ Getting good rankings from search engine results is world unto it's own. My best (and very short) answer to be successful at this is : a) creating good HTML text landing pages for the pages within your site that never or rarly change such as about us, shipping policies, etc. rearrange the format of the HTML so that you can utilies good SEO practices - such as heading tags, strong text, and keywords and phrases near the top of the page. You can test what your page looks like to a search engine spider by using the online Lynx viewer : http://www.yellowpipe.com/yis/tools/lynx/lynx_viewer.php B) getting quality backlinks back to your site. If you sell Pianos for example - contact ALL the people that you deal with like accessories suppliers, piano teachers, piano schools, music schools, etc, etc, etc and ask them to link to you. 2) The test site would need to have a link pointing to it from "somewhere else" in order to have it be crawled. Just becuase it's on the same server, it cannot be crawled if it cannot be found. 3) If you're paranoid, you can always use a robots.txct file at the root of your doamin to disallow spiders and robots into any directory. Create a file called robots.txt and put this in : User-agent: * Disallow: /path/to/test/directory/ The chmod it to 644 http://www.robotstxt.org/wc/faq.html http://en.wikipedia.org/wiki/Robots_Exclusion_Standard david
Guest Posted February 28, 2007 Posted February 28, 2007 david, Thanks again for your very helpful reply. When we switched to OSC, we kept our original domain name, so now when someone searches for our site, they get the old links (which defaults to our main page but the customer doesn't get the link they intended.) So that is why I'm wanting to re-index our site. Thanks for the links and advice, I'll check them out.
davidinottawa Posted February 28, 2007 Posted February 28, 2007 david,Thanks again for your very helpful reply. When we switched to OSC, we kept our original domain name, so now when someone searches for our site, they get the old links (which defaults to our main page but the customer doesn't get the link they intended.) So that is why I'm wanting to re-index our site. Thanks for the links and advice, I'll check them out. Brian - What you need to do is write Engine ReWrites for your old pages, adding in a 301 Permanent Redirect from the old site/pages/directories to the new site/pages/directories Look in your control panel of your host to see if you have this option to do it through a graphcial interface. Under CPanel it's usually a simple 'Redirects' link - with an option to set a permanent or temporary redirect Check that out first - if you don't have the option to do it though yuor host, then post back here and we can go over manual instructions on how to do it. ---> 301 permenant redirects will be much more effictive to the search engine spiders, AND will be reflected on your web site *immediately* I would not recommend resolving htis issue any other way. david
Recommended Posts
Archived
This topic is now archived and is closed to further replies.