Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

kenkja

Pioneers
  • Posts

    256
  • Joined

  • Last visited

Everything posted by kenkja

  1. Hello All, In the absence of any posts, I thought I'd give it go and try out my idea of adapting http://addons.oscommerce.com/info/6783 , as above, I changed the additional line in part 2(2) which adapts checkout_confirmation.php from $_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . " "; to $_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $order->products[$i]['model'] . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . " "; Unfortunately all this did was alter the e-mail from paypal to include the product name twice, clearly I'm barking up the wrong tree with the last post, so don't try it regards ken
  2. Thanks to Steve, I have installed the add-on onto my v2.3.1 install and it certainly goes someway to achieving the result desired, now the paypal confirmation e-mail shows for example ------ Payment details -------------- Description: M01613001 CILINDER NUT x 1 | T0305015 5X15 DACROMET ALLEN BOLT x 1 | Unit price: 1.14 GBP Quantity: 1 Amount: 1.14 GBP Postage: 3.95 GBP Total: 5.09 GBP Good start, but I'd like to take this a few steps further if possible, such that the e-mail would show --- Payment details ------ Description: "Product_model" M01613001 CILINDER NUT x 1 "Product_Price" "Qty X Product_Price" "Product_model" T0305015 5X15 DACROMET ALLEN BOLT x 1 "Qty X Product_Price" "Order Value before Shipping" Postage: 3.95 GBP Total: 5.09 GBP Now I can here you all asking why not go to the admin, all these details are there and you'd be absolutely correct. However, I have Sara's admin IP restriction, (see http://www.oscommerce.com/forums/topic/313323-how-to-secure-your-oscommerce-22-site/page__st__560 ) in place and my partner who works from a different location is not all that computer literate, does not have fixed IP and gets totally lost when I tell him how to reset his IP address, hence i'm trying to make it a simple as possible for him so that he can either check the paypal account or the paypal email account to see full details of any orders. As I understand the add-on (and my understanding of php is not that great), part 2 (2) Find: (Put the entire sentence because there are two equal sentences, the last) ----- <?php } else { ?><TR><TD class=main colspan="3"><?php echo '<b>' . HEADING_PRODUCTS . '</b> <a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '"><span class="orderEdit">(' . TEXT_EDIT . ')</span></a>'; ?></TD></TR><?php } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { Add after: ---------- $_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . " "; Creates the detail for the new information for the description and the separator " | " is created by the third alteration. This is where lack of knowledge of php comes in, i think I need to alter the last line of part 2 (2) $_SESSION['FixOrder'] = $_SESSION['FixOrder'] . $order->products[$i]['model'] . " " . $order->products[$i]['name'] . " x " . $order->products[$i]['qty'] . $order->products[$i]['price'] . "a formula to calculate qty x price" . " "; and to replace the separator in part 3 with a line return <BR> but as I don't really understand what, for example "$order->products[$i]['name']" in part 2(2) of the add in, means or is calling on, I'm unsure if the "model" or "price" statements are actually what I need. Any clues would be gratefully appreciated. regards Ken Nb Sorry if this whole most end up a mess, it seemed okay at first but when I tried to edit it, there where no carriage returns, I've tried to put them back, but I'm also not very good at forums
  3. Hi Steve Is it http://addons.oscommerce.com/info/5655 ?? regards ken
  4. Hello All I'm having a small problem with setting up paypal website standard on v2.3.1. I think I have done all the correct stuff in the admin and at the Paypal end, but the shopping cart does not appear to send to paypal the line by line detail of what goods have been bought, just the goods total, shipping cost and total cost. So when I receive a confirmation of sale e-mail from Paypal, it does not show what goods the customer has bought, see below Extract from Paypals e-mail "Payment details ---------------------------------------------------------------- Description: <my shop name> Unit price: 0.78 GBP Quantity: 1 Amount: 0.78 GBP Postage: 3.95 GBP Total: 4.73 GBP Authorisation expiry date: 26 Mar 2012 10:58:08 BST" Similarly when I go into my paypal account I'm unable to see the details of what has been bought. Is this the expected result or have I done something wrong somewhere. My site does have its own SSL. Regards ken
  5. Thanks Jim, Will do so, will it be safe for me to update to v1.4.4 cheers ken
  6. Hi Jim, I've added the define statements and "MODULE_HEADER_TAGS_EDIT_CATEGORIES_KEYWORDS" has now been replaced by "Category Meta Keywords:" as you would expect. As I had previously removed the module, the Categories Meta Keywords box I guess should not have been shown when editing/creating a new category but it was still there, which may be the part of the additional problem you suspected may happen. I then re-installed the module, the box and title are now still present when editing/creating categories, just as you would expect it to be. After entering "motorcycle," and saving the edit, I viewed the page on the site and it appears to be working normally, viewing the source code for that page, an extra line has appeared <meta name="keywords" content="" /> So the code is clearly trying to do its job, but has not managed to save the keyword which suggests some issue with the database. So via phpmyadmin I checked the database the table categories_description has now three extra fields "head_title" "head_description" and "head_keywords", they are all varchar(255) with utf8_unicode_ci collation. For the one category I have so far altered the head_title & head_description contain the data expected however head_keywords is blank, so saving the category edit/create is not writing to that field, I added "motorcycle trials" to the field via phpmyadmin and reviewed the source code. <meta name="keywords" content="motorcycle trials" /> being the expected result, so that pretty much seems to confirm that the issue is in relation to writing these keywords to the database. Finally I undid my manual alteration to the database, removed the module via admin, rechecked source code, database and edited the category via the admin. As expected the module has been removed from Header Tags list of installed modules and the <meta name="keywords" line removed from the source code. The database still included the head_keywords field and the Keywords box still appears on the edit/create category page. So we have 2 problems 1. When the module is installed its not writing to the database 2. When the module is removed its not deleting the box from the category edit page. To be fair I can live with these issues as they don't appear to hinder the workings of the rest of the site and I do all of my database editing via phpmyadmin by uploading csv files. Just a reminder my header tags install is v1.4.3, hope this helps. regards ken
  7. Sorry Jim I realise now my post did not adequately descriibe of the problem. Firstly i should not have tried to upload this module as it is not in your very detailed of how to use your add-on But I am a fool, and grasped onto the item which most seemed to suit my needs. So 1. I have no idea if the existance of "Category Meta Keywords - Insert" within the admin->modules section is a result of your add-on, for all I know it may well have been there before I uploaded the add-on 2. In relation to "it did not work" after installing this module, on a category create/edit page, i find an additional box, which at present appears underneath the categories_meta_desrciption box. Above it, appears "MODULE_HEADER_TAGS_EDIT_CATEGORIES_KEYWORDS" If I enter any details in this box, the source code for the page , changes to include an extra line of meta category keyword, but there are no keywords specified. If I return to the admin and try to edit a category for which I have previously added info into this box, the previously input info has been deleted. Is this making any sense, Jim
  8. Hi Jim I've just installed v1.4.3 (Have now noticed v1.4.4 is available) without any obvious problems, so went to admin section and installed some of the category related modules, just to get a feel of what they do and again no problem. I then installed module "Category Meta Keywords - Insert", which didn't work and uninstalling the module does not remove it from the editing/creating a category. It does not appear to stop the site from working as far as I know, so no great issue. Could you confirm if this module is part of v1.4.3 as I'm unsure, I can see a file ht_category_keywords_insert.php in the download catalog/includes/modules/header_tags and in catalog/includes/languages/english/modules/header_tags folders but I don't know enough about php to understand how it might be affecting the admin Regards Ken
  9. Heather I've done adapts to v2.3.1, they are not a walk in the park, well done ken
  10. HI Heather, Sorry for the delay in replying, its been a few days since I've been on the forum, as I've been spending all hours god sends uploading cross sell links. Thanks so much for your contribution, my site looks a trillion times better now. ken
  11. Hi All This post relates to http://addons.oscommerce.com/info/8330 Cross sell for v2.3.1, but first two general questions 1. Does anyone know if there is a support post for this add on ? 2. Is it possible to search the whole forum in a way which will limit results to a specific add on. More specifically to the add-on, I've got to Step 12 (2) of the installation notes which asks us to find in catalog/admin/includes/functions/general.php, the following block of code function tep_reset_cache_block($cache_block) { global $cache_blocks; for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) { if ($cache_blocks[$i]['code'] == $cache_block) { if ($cache_blocks[$i]['multiple']) { if ($dir = @opendir(DIR_FS_CACHE)) { while ($cache_file = readdir($dir)) { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($j=0, $k=sizeof($languages); $j<$k; $j++) { $cached_file_unlink = ereg_replace('-language', '-' . $languages[$j]['directory'], $cached_file); if (ereg('^' . $cached_file_unlink, $cache_file)) { @unlink(DIR_FS_CACHE . $cache_file); } } } closedir($dir); } } else { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $cached_file = ereg_replace('-language', '-' . $languages[$i]['directory'], $cached_file); @unlink(DIR_FS_CACHE . $cached_file); } } break; } } } However I can't find it in my install and have just re-downloaded v2.3.1 and checked catalog/admin/includes/functions/general.php and can't find it there, the closest I can find is function tep_reset_cache_block($cache_block) { global $cache_blocks; for ($i=0, $n=sizeof($cache_blocks); $i<$n; $i++) { if ($cache_blocks[$i]['code'] == $cache_block) { if ($cache_blocks[$i]['multiple']) { if ($dir = @opendir(DIR_FS_CACHE)) { while ($cache_file = readdir($dir)) { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($j=0, $k=sizeof($languages); $j<$k; $j++) { $cached_file_unlink = preg_replace('/-language/', '-' . $languages[$j]['directory'], $cached_file); if (preg_match('/^' . $cached_file_unlink . '/', $cache_file)) { @unlink(DIR_FS_CACHE . $cache_file); } } } closedir($dir); } } else { $cached_file = $cache_blocks[$i]['file']; $languages = tep_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $cached_file = preg_replace('/-language/', '-' . $languages[$i]['directory'], $cached_file); @unlink(DIR_FS_CACHE . $cached_file); } } break; } } } The only differences appear to be "ereg" in the installation notes is "preg" in a vanilla install, anyone got a clues what "ereg" and "preg" actually do. cheers ken
  12. HI All, I've just tried adding http://addons.oscommerce.com/info/8175/v,23 Google Analytics for v2.3.1 It includes the following code alteration to includes/template_top.php find </head> and before add <?php if (tep_not_null(GOOGLE_ANALYTICS)) {?> <?php echo GOOGLE_ANALYTICS ;?> <?php } ?> Having done the install, the google analytics key is "echo'd" on every page, which I'm guessing is not what the author expected, any clues how to resolve this. thanks ken
  13. Does anyone know if the adjustment in http://addons.oscommerce.com/info/355 , purchase without account, will work in v2.3.1 thanks ken
  14. Hello Ian My aplogies re the SQL Command, your database name should not be encased inverter commas, so should be ALTER SCHEMA yourdatabase DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci this command should ensure that all future tables you add will be utf8 with utf8_unicode_ci collation but it does not alter the existing. I followed xpajun's advice in page 2 of http://www.oscommerce.com/forums/topic/302941-french-letter-before-every-price-a/ to change the existing tables ken
  15. HI Ian, me again I just checked the thread in my first post to you, the second to last post from Michael seems to have an answer, your could try this first ken http://forums.oscomm...-every-price-a/
  16. Hi Ian what is the database collation, let me know & I'll try it Try entering the £ in the database rather than admin. ken
  17. Hello Ian I've had the same problem with  character, turned out in my case the database collation somehow always defaults to latin_swedish when a new install is undertaken I ran this sql to resolve it, ALTER SCHEMA 'yourdatabase' DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_unicode_ci ; or you can try changing any £ to the html equivalent of a pound sign, £ (it must have both the & and the semi-colon). There is also a post about this issue see http://www.oscommerce.com/forums/topic/302941-french-letter-before-every-price-a/ ken
  18. Hi, as I'd suspected when I changed "table" to "tableeu" I had actually removed some the calls to Tables in the database, anyway just to avoid confusion decided to change the name of each relevant php files to euship.php, the code below does now work in version 2.3.1 to give you an extra Table Rate to install. Includes/languages/modules/shipping/euship.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright (c) 2002 osCommerce Released under the GNU General Public License */ define('MODULE_SHIPPING_EUSHIP_TEXT_TITLE', 'Table Rate EU'); define('MODULE_SHIPPING_EUSHIP_TEXT_DESCRIPTION', 'Table Rate EU'); define('MODULE_SHIPPING_EUSHIP_TEXT_WAY', 'Best Way'); define('MODULE_SHIPPING_EUSHIP_TEXT_WEIGHT', 'Weight'); define('MODULE_SHIPPING_EUSHIP_TEXT_AMOUNT', 'Amount'); ?> and for includes/modules/shipping/euship.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url] Copyright (c) 2008 osCommerce Released under the GNU General Public License */ class euship { var $code, $title, $description, $icon, $enabled; // class constructor function euship() { global $order; $this->code = 'euship'; $this->title = MODULE_SHIPPING_EUSHIP_TEXT_TITLE; $this->description = MODULE_SHIPPING_EUSHIP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_EUSHIP_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_EUSHIP_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_EUSHIP_STATUS == 'True') ? true : false); if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_EUSHIP_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_EUSHIP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes; if (MODULE_SHIPPING_EUSHIP_MODE == 'price') { $order_total = $this->getShippableTotal(); } else { $order_total = $shipping_weight; } $tableeu_cost = preg_split("/[:,]/" , MODULE_SHIPPING_EUSHIP_COST); $size = sizeof($euship_cost); for ($i=0, $n=$size; $i<$n; $i+=2) { if ($order_total <= $euship_cost[$i]) { $shipping = $euship_cost[$i+1]; break; } } if (MODULE_SHIPPING_EUSHIP_MODE == 'weight') { $shipping = $shipping * $shipping_num_boxes; } $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_EUSHIP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_EUSHIP_TEXT_WAY, 'cost' => $shipping + MODULE_SHIPPING_EUSHIP_HANDLING))); if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_EUSHIP_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Enable Table Method', 'MODULE_SHIPPING_EUSHIP_STATUS', 'True', 'Do you want to offer table rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Table', 'MODULE_SHIPPING_EUSHIP_COST', '25:8.50,50:5.50,10000:0.00', 'The shipping cost is based on the total cost or weight of items. Example: 25:8.50,50:5.50,etc.. Up to 25 charge 8.50, from there to 50 charge 5.50, etc', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Table Method', 'MODULE_SHIPPING_EUSHIP_MODE', 'weight', 'The shipping cost is based on the order total or the total weight of the items ordered.', '6', '0', 'tep_cfg_select_option(array(\'weight\', \'price\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_EUSHIP_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_EUSHIP_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_EUSHIP_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_EUSHIP_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_EUSHIP_STATUS', 'MODULE_SHIPPING_EUSHIP_COST', 'MODULE_SHIPPING_EUSHIP_MODE', 'MODULE_SHIPPING_EUSHIP_HANDLING', 'MODULE_SHIPPING_EUSHIP_TAX_CLASS', 'MODULE_SHIPPING_EUSHIP_ZONE', 'MODULE_SHIPPING_EUSHIP_SORT_ORDER'); } function getShippableTotal() { global $order, $cart, $currencies; $order_total = $cart->show_total(); if ($order->content_type == 'mixed') { $order_total = 0; for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { $order_total += $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']); if (isset($order->products[$i]['attributes'])) { reset($order->products[$i]['attributes']); while (list($option, $value) = each($order->products[$i]['attributes'])) { $virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id"); $virtual_check = tep_db_fetch_array($virtual_check_query); if ($virtual_check['total'] > 0) { $order_total -= $currencies->calculate_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']); } } } } } return $order_total; } } ?> However, having installed the new EU shipping module and setting the appropriate parameters for the new table rate, on the order confirmation page, for a customer based in the EU but not the UK, it correctly identifies that euship.php should be used but doesn't add its cost to the order, so I'm still missing something, any clues thanks Ken
  19. Hello should this procedure work for Table rate shipping. I created the 2 copies, called them tableeu.php, replaced all instances of "table" (regardless of capitalisation) with "tableeu" when I tried to install the new shipping module, i get 1146 - Table 'mydomain.TABLEEU_CONFIGURATION' doesn't exist select configuration_value from TABLEEU_CONFIGURATION where configuration_key = 'MODULE_SHIPPING_TABLEEU_STATUS' Thanks ken
  20. I'm not sure why, but removing the //bof .... & //eof... from code copied into admin/catgories.php (2b in readme.txt) seems to have corrected the admin. ken
  21. Regarding last post, it would be great to have the first lines of the created arrays language specific, but as it is reasonable obvious what should be done even if you don't speak/read english, its not a big deal. More concerning is I don't think I have the install correct as I have 2 issues which I didn't expect. 1. Unless there is at least 1 product with YMM attributes the whole index.php page looses its formatting quite dramatically. The centre section (which contains the user greeting) disappears, both left & right _column(s) change width, the "OS Commerce" logo become left justified and the YMM box has no title. Clearly the obvious answer is to keep a product with YMM attributes, but is this normal ?? 2. Within Admin create/edit a product 2 lines of the coding appear as text between the page title and the product status lines - Page Title - New Product in "Clothing =>Shirts" Text Code - //bof Year_Make_Model Contribution V2.3.x by Dunweb Designs Text Code - //eof Year_Make_Model Contribution V2.3.x by Dunweb Designs Then - Product Status In Stock/Out of stock line Again as these lines are only text, they don't really matter, but are something I didn't expect. I've doubled checked the files affected by the install with the readme.txt file and copied all of them into a spreadsheet along with all of those from the "Drop on Top Files" folder, then asked the spreadsheet to compare each line. Aside from some changes in includes/application_top.php as required by the Secuirty Pro & Ip Trap contributions and some colour changes in stylesheet.css, all of my files appear identical to the "Drop on Top Files" with the exception of Includes/application_top.php My Code - Define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3'); Drop on Top - Define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3.1'); Include/Functions/general.php Instruction 8b of the readme.txt requires the following code to be added before the last ?> the two lines in Red bold type are not in the "Drop on Top Files" version //bof Year_Make_Model Contribution v2.3.x by Dunweb Designs function YMM_get_categories_where($id,$where){ global $languages_id; $cq = tep_db_query("SELECT c.categories_id, c.parent_id FROM " . TABLE_CATEGORIES . " c," . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND cd.language_id = '" . (int)$languages_id . "'"); $inc_cat = array(); while ($r = tep_db_fetch_array($cq)) $inc_cat[] = array ('id' => $r['categories_id'],'parent' => $r['parent_id']); $cat_info = array(); for ($i=0; $i < sizeof($inc_cat); $i++) $cat_info[$inc_cat[$i]['id']] = array ('parent'=> $inc_cat[$i]['parent'],'path' => array($inc_cat[$i]['id'])); for ($i=0; $i < sizeof($inc_cat); $i++) { $cat_id = $inc_cat[$i]['id']; while ($cat_info[$cat_id]['parent'] != 0){ $cat_info[$inc_cat[$i]['id']]['path'] [] = $cat_info[$cat_id]['parent']; if($cat_info[$cat_id]['parent'] == $id) $cat_info[$inc_cat[$i]['id']]['ind'] = count($cat_info[$inc_cat[$i]['id']]['path']) - 2; $cat_id = $cat_info[$cat_id]['parent']; } $cat_info[$inc_cat[$i]['id']]['path'] [] = 0; if($cat_info[$cat_id]['parent'] == $id) $cat_info[$inc_cat[$i]['id']]['ind'] = count($cat_info[$inc_cat[$i]['id']]['path']) - 2; } $ids = ''; if(trim($where) != 'p.products_id in () and'){ for ($i=0; $i < sizeof($inc_cat); $i++) { if(isset($cat_info[$inc_cat[$i]['id']]['ind'])){ $q = tep_db_query("select c.categories_id FROM " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE $where p.products_id = pc.products_id AND c.categories_id = pc.categories_id AND p.products_status = '1' AND c.categories_id = ".$cat_info[$inc_cat[$i]['id']]['path'][0]." AND c.categories_id = cd.categories_id AND cd.language_id = '" . (int)$languages_id . "' LIMIT 1"); if(tep_db_num_rows($q) == 1) $ids .= ($ids != '' ? ',' : '') . $cat_info[$inc_cat[$i]['id']]['path'][$cat_info[$inc_cat[$i]['id']]['ind']]; } } return ($ids != '' ? ' c.categories_id in ('.$ids.') and ' : ''); } } //eof Year_Make_Model Contribution v2.3.x by Dunweb Designs Also the "Drop on top files" folder includes categories.php with the Admin/Includes/Languages directory, however in my install this is in admin/includes/languages/english ken
×
×
  • Create New...