Jump to content

oakhill

Members
  • Content count

    49
  • Joined

  • Last visited

Everything posted by oakhill

  1. Hi I have installed two different Stock Update Contributions - Stockupdate and Quick Price Update (with the stock update facility). Both work fine however they are not sorting alphabetically which is a problem as I sometimes have over a hundred products in a section. Has someone altered this contribs to sort alphabetically by product name.? I am not even sure what they are sorting by as the products are all over the place. Both contribs are fantastic and I will use them if I can get them to sort! Below is the code for the stockupdate.php which is the only file installed exp for the language one. Help!!! */ include('includes/application_top.php'); /// optional parameter to set max products per row: $max_cols = 6; ?> <!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"> </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%" height="300" valign="top"> <table style="border:none" border="0" width="100%" align="center"><tr><td class="smalltext"> <?php // we've done nothing cool yet... $msg_stack = '' . TEXT_FETCH_DB . ''; if ($HTTP_POST_VARS['stock_update']) { //set counter $stock = 0; $status_a = 0; $status_d = 0; while (list($key, $value) = each($stock_update)) { // update the quantity in stock $update = tep_db_query("UPDATE products SET products_quantity = $value WHERE products_id = $key"); $stock_i++; // we're de-re-activating the selected products if ($HTTP_POST_VARS['update_status']) { if ($value >= 1 ) { $dereac = tep_db_query("UPDATE products SET products_status = 1 WHERE products_id = $key"); $status_a++; }else{ $dereac = tep_db_query("UPDATE products SET products_status = 0 WHERE products_id = $key"); $status_d++; } } } $msg_stack = '<br>' . UPDATED_QUANTITY . ' ' . $stock_i . ' ' . UQ_PRODUCTS . '<br>' . ACTIVATED_STATUS . ' ' . $status_a . ' ' . UQ_PRODUCTS . '<br>' . DE_ACTIVATED_STATUS . ' ' . $status_d . ' products</class>'; } ?> <tr> <td class="pageHeading" align="left"><?php echo HEADING_TITLE; ?></td> <td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> <table border="0" width="90%" align="center"><tr><td class="smalltext"> <br><form method="post" action="stockupdate.php"> <?php // first select all categories that have 0 as parent: $sql = tep_db_query("SELECT c.categories_id, cd.categories_name from categories c, categories_description cd WHERE c.parent_id = 0 AND c.categories_id = cd.categories_id AND cd.language_id = $languages_id"); echo '<table border="0" align="center"><tr>'; while ($parents = tep_db_fetch_array($sql)) { // check if the parent has products $check = tep_db_query("SELECT products_id FROM products_to_categories WHERE categories_id = '" . $parents['categories_id'] . "'"); if (tep_db_num_rows($check) > 0) { $tree = tep_get_category_tree(); $dropdown= tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"'); //single $all_list = '<form method="post" action="stockupdate.php"><th class="smallText" align="left" valign="top">' . TEXT_ALL_CATEGORIES . '<br>' . $dropdown . '</form></th>'; } else { // get the tree for that parent $tree = tep_get_category_tree($parents['categories_id']); // draw a dropdown with it: $dropdown = tep_draw_pull_down_menu('cat_id', $tree, '', 'onChange="this.form.submit();"'); $list .= '<form method="post" action="stockupdate.php"><th class="smallText" align="left" valign="top">' . $parents['categories_name'] . '<br>' . $dropdown . '</form></th>'; } } echo $list . $all_list . '</form></tr></table><p>'; // see if there is a category ID: if ($HTTP_POST_VARS['cat_id']) { // start the table echo '<form method="post" action="stockupdate.php"><table border="0" width="100%"><tr>'; $i = 0; // get all active prods in that specific category $sql2 = tep_db_query("SELECT p.products_id, p.products_model, p. products_quantity, p.products_status, p.products_image, pd.products_name from products p, products_to_categories ptc, products_description pd where p.products_id = ptc.products_id and p.products_id = pd.products_id and language_id = $languages_id and ptc.categories_id = '" . $HTTP_POST_VARS['cat_id'] . "'"); while ($results = tep_db_fetch_array($sql2)) { $i++; echo '<td class="main" align="center">' . tep_image(DIR_WS_CATALOG . DIR_WS_IMAGES . $results['products_image'], 'ID ' . $results['products_id'] . ': ' . $results['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br>'; echo '<font size="1" color="#ff0000"><b>' . $results['products_model'] . '</b></font><br>' . $results['products_name'] . '<br>'; echo '<input type="text" size="3" name="stock_update[' . $results['products_id'] . ']" value="' . $results['products_quantity'] . '">'; echo (($results['products_status'] == 0) ? ' ' . tep_image(DIR_WS_LANGUAGES . $language . '/images/' . 'blokje_niet_actief.gif') . ' ' : ' ' . tep_image(DIR_WS_LANGUAGES . $language . '/images/' . 'blokje_actief.gif') . ' '); // echo (($results['products_status'] == 0) ? ' <img src="' . DIR_WS_LANGUAGES . $language . '/images/' . 'blokje_niet_actief.gif' . '"> ' : ' <img src="' . DIR_WS_LANGUAGES . $language . '/images/' . 'blokje_actief.gif' . '"> '); echo '</i></td>'; if ($i == $max_cols) { echo '</tr><tr>'; $i =0; } } echo '<input type="hidden" name="cat_id" value="' . $HTTP_POST_VARS['cat_id'] . '">'; echo '</tr><td class="smalltext" align="center" colspan="10"><br><br><br><br>'; echo '<input type="checkbox" name="update_status">' . TEXT_STOCK_UPDATE . '<p>'; echo tep_image_submit('button_update.gif', IMAGE_UPDATE) . '</td></tr><td class="main" colspan="30" align="left"><br><b>' . LAST_ACTION . '</b><br>' . $msg_stack . '</b></font></td></tr></form>'; } ?> </tr></table> </td> </tr></table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <!-- footer //--> <?php require(DIR_WS_INCLUDES . 'footer.php'); ?> <!-- footer_eof //--> </body> </html> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  2. oakhill

    QUICK PRICE/STOCK UPDATE

    Hi I installed this contribution which works beautifully for me! However, just wondering if there was a way I can get the products to sort alphabetically by their name. I am not sure how it is sorted but I have a rather large catalog and it would make life so much easier if it was sorted alphabetically! I have had a look around but not sure where to start! Thanks in advance B)
  3. Hi, I installed the Bestseller contribution (I think 1.4) that scrolls and has the admin feature. It all works but slows the site loading time down heaps. I still have it installed but have no products selected because as soon as I do, it slows the loading. I have gone through the instructions and reinstalled and it all works fine except for this one issue. I have tried it with expiry dates and without. I am wondering if it is something to do with the image size and if so, how can I alter it? My site is live so don't want to leave it running while it is causing this issue! Has anyone else had this problem....I love the concept and want to use it ! My Shop Thanks heaps! :)
  4. Hi Mibble, I finally figured that out last night. I worked out how the Products Extra Fields added fields (ie what the headers were called) and set up the file using the fields I needed to add and it all uploaded beautifully. The problem was just figuring out what the field names were for the extra ones! I was using the download file to delete and move items into categories but then found the wonderful multi product delete/move contribution and that is all so much easier now - just select and delete or move! I was so set on concentrating on the download file - realised it was the upload file that was more important! Thank you for your advice! Crisis is over hopefully! :thumbsup:
  5. Hi all I am in all sorts of problems with the Easy Populate file. Has anyone had trouble downloading a large complete file (approx 4000 products) - I added the Product Extra Fields code and it was working fine. I added data and it would upload but not download. Tried to download again today and eventually it timed out. I took the code out and returned to the original file and it worked fine again but of course didn't get the extra fields. I have now created more categories and divided the products up further which mean I have approx 2000 products listed in at least 2 categories (ie by brand and by colour). Now it will download all files except for the complete one (which is the one which should have the extra fields in it if it was all working! Is there by any chance anyone could set up a piece of code which would create a download that just has the Product Name and the Product Extra Fields? I have been informed by my host that I am creating too much of a drain on the servers trying to solve this so need a solution quick!!! :'( I love Easypopulate and it has made my life so much easier but the last two days have been hell as I have been trying to solve this issue!! Any help or advice would be appreciated Thanks!!
  6. Hi all Added the code done by sparkin in April to integrate the Product Extra Fields contribution with easy populate and everything was working perfectly (loved it - thank you!!). Now all of a sudden, the file is taking forever to download and often brings down an empty file. Otherwise it seems to just hang - doesn't through any errors either. It was uploading fine as well but now has also fallen over. Has anyone experienced this before - I was so happy that it was all working!! All I did was add the extra code. Thanks!
  7. Hi all - first I would like to say how much I love this software - I am having a ball!! Secondly, have just installed the contribution Printable Catalog V3.2 but I have found the prices are showing without tax. I have set to true in Admin -Configuration-My Store-Display prices with tax but it has't changed on the Printable Catalog area. Is there somewhere else I have to set? The Mod V3.2 said that there was a tax option. Help! Thanks
  8. oakhill

    Small Order Surchage

    Had some inspiration and I solved it - its a bit messy but it works! :thumbsup: Installed the Handling fee contribution (which actually did the same as the low order fee - no change) and altered line 40: if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) < MODULE_ORDER_TOTAL_HANDLINGFEE_ORDER_UNDER) ) { All I changed was the < (was >) before MODULE. I set the handling fee to activate on orders below $1.00 and to charge -$15.00. This counteracted the small order surchage. As soon as the order was above $1.00, the handling fee does not apply but the surcharge does. I have changed the name of the handling fee to refer to the free cuttings. Once the order was above $25, no charges apply! Hope this all makes sense but just wanted to put it up in the forum in case anyone else was looking to do the same thing! Now onto the next problem......!! :(
  9. oakhill

    Small Order Surchage

    Hi all I have spent hours trying to get this to work and am really needing some help. I want to set the low order surchage to apply to orders more than $1.00 and less then $125. This is because we provide a free cutting service (fabrics) and the surcharge does not apply to this. Once the customer actually purchases a length of fabric, the order total will be above $0.00 and this is when I want the surchage to kick in. Once the order reaches $125, then there is no surcharge either. In otherwords , I want the free cutting service to be totally free irregardless of how many items (still add up to $0.00) but I do need a small order surcharge for the fabric orders. I have been playing round with the ot_loworderfee.php file and my reasoning is I just have to get it to apply to orders between $0.01 and $125. But every formula I try doesn't work - I don't know much about php formulas. It would be good to add to the Admin side another field to say apply to orders above this amount as well as the current one to say apply to orders below this amount. I did actually try to get the free handling charge contribution to adjust the total (ie if the subtotal adds up to $0.00 then a free hangling charge of -$15.00 would be applied which would remove the surcharge but it all got to complicated as that contribution works on quantity which meant that if there was 2 free samples, -$30 would be removed! Hopefully this makes sense - I have managed to get it all working in terms of free shipping and payment - this is the last step! Any help would be appreciated. If you want to visit the site it is www.wgtrade.com.au Thanks!!
  10. oakhill

    Small Order Surchage

    Is anyone able to help or suggest an alternative - I am really stuck on this!! Thanks! :(
  11. oakhill

    Bill Customer Account

    Hi, I am wondering if anyone knows of a module which enables a customer to place an order and have it billed to thier account? We have customers who are on 7 day accounts etc and would like to be able to offer this facility on the website. I have actually managed to configure Oscommerce so a customer uses thier existing customer number to log on instead of their email address. They can then place an order which we can match up with thier details in our accounting system via the customer number reference. Just want to add the facility of billing the customer to the existing choices of credit card, direct debit etc. Thanks!! :)
  12. oakhill

    JUST RELEASED! Printable Catalog

    Hi Just installed this contribution but when called up, the printable catalog page comes up blank! I followed the instructions but either I have missed something or there is something wrong with the installation! Help! Thanks!
  13. oakhill

    Article Manager v1.0

    Hi Eric, Thanks for that - that fixed the errors! Yay! One more question - how did you get the article pages to pick up the template. I have had a play round with the coding but was wondering if you have got this working already? so close....! :( Thanks!
  14. oakhill

    Article Manager v1.0

    Hi I use this contribution on my website with no problems. However, I am doing another site using MS2-MAX and want to install it there. The admin side works fine but the catalog side has issues (due to the template layouts I guess) plus I get errors such as: Fatal error: Call to undefined function: clean_html_comments() in /home/httpd/vhosts/fabricandleathercare.com.au/httpdocs/catalog/articles.php on line 350 And Fatal error: Call to undefined function: clean_html_comments() in /home/httpd/vhosts/fabricandleathercare.com.au/httpdocs/catalog/includes/article_header_tags.php on line 104 Has anyone successfully installed this contribution into MS2-MAX version of Oscommerce? Any help would be appreciated! Thanks
  15. oakhill

    Article Manager v1.0

    Hi Just to let you know I seem to have fixed it by changing the Maximum Display Upcoming Articles from 5 to 10 in the admin menu. Will go through it all more thoroughly today but seems ok now!
  16. oakhill

    Article Manager v1.0

    Hi Just installed the latest version of Article manager and although the admin seems to work fine, this is what I get when I click on a link on the site (I have disabled it at the moment until I can get it working...) Warning: Division by zero in /home/httpd/vhosts/oakhillnailspa.com.au/httpdocs/catalog/includes/classes/split_page_results.php on line 59 1064 - You have an error in your SQL syntax near 'MAX_ARTICLES_PER_PAGE' at line 1 select a.articles_id, a.authors_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_name, td.topics_name, a2t.topics_id from articles a, articles_description ad left join authors au on a.authors_id = au.authors_id, articles_to_topics a2t left join topics_description td on a2t.topics_id = td.topics_id where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_status = '1' and a.articles_id = a2t.articles_id and ad.articles_id = a2t.articles_id and ad.language_id = '1' and td.language_id = '1' and a2t.topics_id = '1' order by a.articles_date_added desc, ad.articles_name limit -0, MAX_ARTICLES_PER_PAGE Has anyone else had this problem...the contibution seems perfect for what I need so it would be great if I can get this issue solved. I am not very good at SQL so not quite sure where I should look to fix! Knowing me, its probably something I have done!! Thanks!
  17. Hi, I am trying to get the master password contribution to work but have hit a problem with an SQL Error. I get this error: INSERT INTO configuration( configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function ) VALUES ( '188', 'Master Password', 'MASTER_PASS', 'yourpassword', 'This password will allow you to login to any customers account.', 1, 23, '2004-06-15 07:10:52', '2004-06-15 07:10:52', NULL , NULL ) MySQL said: #1062 - Duplicate entry '188' for key 1 Has anyone had this problem before? Thanks!
  18. oakhill

    "select subcategories" Font

    Don't panic - I have fixed the problem. Somehow I had managed to remove the InfoBoxHeadingA info from the stylesheet! Crisis over!
  19. Hi I am sure I saw a solution for this over the weekend but I can't for the life of me find it again - wondering if anyone can help. I have the browse by categories contribution installed and I just want to change the font that is used for the "Select one of these Sub-Categories " heading. I am guessing its got something to do with the style sheet but not sure where. Its showing I think as a courier font plus is too big when it should be arial. I am sure I saw a reference to this over the last few days but stupid me forgot to write it down! Here is a link to an example on my website My site Can anyone help :) Thanks!
  20. oakhill

    Categories Description MS2 1.5.

    HI - not sure if this is the right place to ask this question but here goes...I have the categories description contribution working well. However I was wondering if there was a way to get the description entered appearing in the metatags. I have this working for products but have tried a few times to pick up the category descriptions in the index.php metatags but to no success. Just wondering if anyone else has acheived this and if so, how? Hope that makes sense.. Thanks heaps!
  21. oakhill

    Bestseller V1.4

    Hi, I installed the Best Sellers V1.4 Contribution and it is working beautifully except it causes my site to load really slowly. I have tried adding just one product and it makes no difference. If I have no products selected as best sellers, the site loads in an instant so have isolated the problem to this contribution. Just for the record I have got the configuration cache contribution loaded as well. Has anyone else experienced this or can anyone suggest a fix! I have had to turn this feature off but would really still like to use it! Thanks
  22. oakhill

    Faster Page Loads

    Hi, am having a bit of trouble getting this contribution to work. My site loads rather slowly so I am hoping this will fix it! The main problem is that the cache file is not being generated and I think it is because I have not created the folder in the right place and also prob have not put the right path. Can someone please explain exactly where this folder should go..my server is set up with folders such as httpdocs, httpsdocs, subdomains, statistics, private etc. Do I create at that level or some where else - as you can tell I am a little lost. I do know however how to set permissions! I tried adding a folder but it wouldn't let me! My site is highly modified but I am not sure if this is causing the slow loading or not. My site is http://www.oakhillnailspa.com.au/catalog/index.php (not live yet) Any help would be appreciated! Thanks!
  23. oakhill

    Browse by Categories

    Thanks Eathan - I will have to sit down and carefully work through as per your instructions. My SQL skills aren't great but I am learning! Will let you know how it goes! :)
  24. oakhill

    Browse by Categories

    HI Straider Thanks for the advice - I know have it working to some extent in that the error has gone! However, the effect of the enable/disable categories isn't carrying onto the Browse by Category area. Wjen I turn a category off in the admin area, it makes the category disappear in the category list on the left hand side box but it still appears in the browse by category box in the center. Have had a play around but my php skills are only beginner level so have had no success as yet! Here is my code for catalog/index.php <?php /* $Id: index.php,v 1.1 2003/06/11 17:37:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); // the following cPath references come from application_top.php $category_depth = 'top'; if (isset($cPath) && tep_not_null($cPath)) { $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $cateqories_products = tep_db_fetch_array($categories_products_query); if ($cateqories_products['total'] > 0) { $category_depth = 'products'; // display products } else { $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'"); $category_parent = tep_db_fetch_array($category_parent_query); if ($category_parent['total'] > 0) { $category_depth = 'nested'; // navigate through the categories } else { $category_depth = 'products'; // category has no products, but display the 'no products' message } } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT); ?> <!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> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_eof //--> <!-- body //--> <table border="0" width="750" cellspacing="1" cellpadding="1" align="center"> <tr> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- left_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> <!-- left_navigation_eof //--> </table></td> <!-- body_text //--> <?php if ($category_depth == 'nested') { $category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'"); $category = tep_db_fetch_array($category_query); ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><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_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <!-- DWD Contribution -> Remove: Browse by Categories v2.2. //--> <!-- <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> //--> <!-- DWD Contribution End. //--> <?php //DWD Contribution - remove: Browse Categories if (isset($cPath) && strpos('_', $cPath)) { //check to see if there are deeper categories within the current category $category_links = array_reverse($cPath_array); for($i=0, $n=sizeof($category_links); $i<$n; $i++) { $categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'"); $categories = tep_db_fetch_array($categories_query); if ($categories['total'] < 1) { // do nothing, go through the loop } else { //$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); // BOF Enable - Disable Categories Contribution-------------------------------------- /* $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); */ $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); // EOF Enable - Disable Categories Contribution-------------------------------------- break; // we've found the deepest category the customer is in } } } else { //$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); // BOF Enable - Disable Categories Contribution-------------------------------------- /* $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); */ //$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name"); // EOF Enable - Disable Categories Contribution-------------------------------------- } $number_of_categories = tep_db_num_rows($categories_query); $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $cPath_new = tep_get_path($categories['categories_id']); $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>' . $categories['categories_name'] . '</a></td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } //DWD Contribution end // needed for the new products module shown below $new_products_category_id = $current_category_id; ?> <!--DWD Contribution - remove: Browse by Categories V2.2 </tr> </table></td> </tr> //--> <!--DWD Contibution End. //--> <!--DWD Contibution -> Add: Browse by Categories v2.0. !--> <tr> <td><?php $browse_category_id = $current_category_id; include(DIR_WS_MODULES . FILENAME_BROWSE_CATEGORIES); ?></td> </tr> <!-- DWD Contribution End. !--> </tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td> </tr> </table></td> </tr> </table></td> <?php } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) { // create column list $define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE, 'PRODUCT_LIST_BUY_NOW' => PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model, '; break; case 'PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'PRODUCT_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case 'PRODUCT_LIST_WEIGHT': $select_column_list .= 'p.products_weight, '; break; } } // show the products of a specified manufacturer if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } } if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by pd.products_name"; break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); $listing_sql .= ' order by '; switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_NAME': $listing_sql .= "pd.products_name " . ($sort_order == 'd' ? 'desc' : ''); break; case 'PRODUCT_LIST_MANUFACTURER': $listing_sql .= "m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_QUANTITY': $listing_sql .= "p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_IMAGE': $listing_sql .= "pd.products_name"; break; case 'PRODUCT_LIST_WEIGHT': $listing_sql .= "p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; case 'PRODUCT_LIST_PRICE': $listing_sql .= "final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; break; } } ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <?php // optional Product List Filter if (PRODUCT_LIST_FILTER > 0) { if (isset($HTTP_GET_VARS['manufacturers_id'])) { $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name"; } else { $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name"; } $filterlist_query = tep_db_query($filterlist_sql); if (tep_db_num_rows($filterlist_query) > 1) { echo ' <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . ' '; if (isset($HTTP_GET_VARS['manufacturers_id'])) { echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']); $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)); } else { echo tep_draw_hidden_field('cPath', $cPath); $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)); } echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']); while ($filterlist = tep_db_fetch_array($filterlist_query)) { $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']); } echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"'); echo '</form></td>' . "\n"; } } // Get the right image for the top-right $image = DIR_WS_IMAGES . 'table_background_list.gif'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"); $image = tep_db_fetch_array($image); $image = $image['manufacturers_image']; } elseif ($current_category_id) { $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'"); $image = tep_db_fetch_array($image); $image = $image['categories_image']; } ?> <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING); ?></td> </tr> </table></td> <?php } else { // default page ?> <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><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_image(DIR_WS_IMAGES . 'table_background_default.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main"><?php echo tep_customer_greeting(); ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main"><?php echo TEXT_MAIN; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><?php include(DIR_WS_MODULES . FILENAME_FEATURED); ?></td> </tr> <?php include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS); ?> </table></td> </tr> </table></td> <?php } ?> <!-- body_text_eof //--> <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> <!-- right_navigation //--> <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> <!-- right_navigation_eof //--> </table></td> </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'); ?> My oscommerce part of the site is not live and is not quite finished, but if it helps, you can visit the actual page at http://www.oakhillnailspa.com.au/catalog/i...?cPath=28_21_22 The catagory I have turned off is Beautiful Nails. It has disappeared from the list in the Category info box but is still listed in the middle area. Hope you can find a solution! Thanks again for your help! :D
  25. oakhill

    Browse by Categories

    Just a quick question - I installed Browse by Categories V2.5 which works fine...however I installed the modification to enable and disable product categories 1.4 (http://www.oscommerce.com/community/contributions,326) but this won't seem to work with the Browse by Categories page. The following error shows on the category page - Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/httpd/vhosts/mysite.com/httpdocs/catalog/includes/functions/database.php on line 99 The only thing difference seems to be in the catalog/index.php as some the code that needs to be changed for the Enable/Disable mod has been removed by the Browse by Categories Mod. They both seem to work fine in all other parts of the site. Just wondering if anyone else has used these two contributions together successfully! Otherwise I will have to remove one! Thanks
×