Jump to content

oakhill

Members
  • Content count

    49
  • Joined

  • Last visited

Profile Information

  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 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:
  4. 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!!
  5. 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!
  6. 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......!! :(
  7. oakhill

    Small Order Surchage

    Is anyone able to help or suggest an alternative - I am really stuck on this!! Thanks! :(
  8. 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!!
  9. 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!! :)
  10. 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!
  11. 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!
  12. 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
  13. 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!
  14. 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!
  15. 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!
×