Jump to content
Latest News: (loading..)

Patty

Members
  • Content count

    309
  • Joined

  • Last visited

4 Followers

Profile Information

Recent Profile Visitors

16,067 profile views
  1. Tks for your reply! Will try that!
  2. Hi there. I'm using this addon in a couple of stores and it seemed to be working fine. Very easy and simple, that's why I picked this one: https://apps.oscommerce.com/UQxeo&newletters-subscribers-manager But recently these stores have been receiving a huge volume of subscription that is clearly spam! Dozens a day every single day, which is not normal for stores that don't have that amount of traffic! I'm not a programmer, so I don't know how to adapt the code to maybe insert a captcha or something like that to prevent spam. Can anybody help me find a solution for this problem? TIA!
  3. Patty

    ULTIMATE Seo Urls 5 - by FWR Media

    I know this is an old post, but the error is still happening and this fixed it. Tks a lot!!
  4. Thank you, but the issue is that the date the special was added was not inserted on the database, so sorting won't work. I found a way around it that seems to be working fine. I replaced this line $today = date("Y-m-d H:i:s"); tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('','$productid','$specialprice','$today','','','','1');"); with // $today = now(); tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) VALUES ('$productid','$specialprice',now(),'','1');");
  5. Hi there. I know it's been a long time, but I just installed this contribution and it works great, except for one little thing: it does not insert in the database the date the special price was added, so products won't show as newest on the Specials page in the store. I'm not a coder so I can't fix this by myself. Can someone help me with that? I hate to do this but here's the code to expedite things: <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); require(DIR_WS_CLASSES . 'currencies.php'); $currencies = new currencies(); $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); if (tep_not_null($action)) { switch ($action) { case 'setflag': tep_set_specials_status($HTTP_GET_VARS['id'], $HTTP_GET_VARS['flag']); tep_redirect(tep_href_link(FILENAME_SPECIALS, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'sID=' . $HTTP_GET_VARS['id'], 'NONSSL')); break; case 'insert': $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']); $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']); $expdate = tep_db_prepare_input($HTTP_POST_VARS['expdate']); if (substr($specials_price, -1) == '%') { $new_special_insert_query = tep_db_query("select products_id, products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $new_special_insert = tep_db_fetch_array($new_special_insert_query); $products_price = $new_special_insert['products_price']; $specials_price = ($products_price - (($specials_price / 100) * $products_price)); } $expires_date = ''; if (tep_not_null($expdate)) { $expires_date = substr($expdate, 0, 4) . substr($expdate, 5, 2) . substr($expdate, 8, 2); } tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . ", '1')"); tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'])); break; case 'update': $specials_id = tep_db_prepare_input($HTTP_POST_VARS['specials_id']); $products_price = tep_db_prepare_input($HTTP_POST_VARS['products_price']); $specials_price = tep_db_prepare_input($HTTP_POST_VARS['specials_price']); $expdate = tep_db_prepare_input($HTTP_POST_VARS['expdate']); if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price)); $expires_date = ''; if (tep_not_null($expdate)) { $expires_date = substr($expdate, 0, 4) . substr($expdate, 5, 2) . substr($expdate, 8, 2); } tep_db_query("update " . TABLE_SPECIALS . " set specials_new_products_price = '" . tep_db_input($specials_price) . "', specials_last_modified = now(), expires_date = " . (tep_not_null($expires_date) ? "'" . tep_db_input($expires_date) . "'" : 'null') . " where specials_id = '" . (int)$specials_id . "'"); tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . '&sID=' . $specials_id)); break; case 'deleteconfirm': $specials_id = tep_db_prepare_input($HTTP_GET_VARS['sID']); tep_db_query("delete from " . TABLE_SPECIALS . " where specials_id = '" . (int)$specials_id . "'"); tep_redirect(tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'])); break; } } require(DIR_WS_INCLUDES . 'template_top.php'); ?> <?php //Fetch all variables $fullprice = (isset($_GET['fullprice']) ? $_GET['fullprice'] : ''); $productid = (isset($_GET['productid']) ? (int)$_GET['productid'] : '0'); $inputupdate = (isset($_GET['inputupdate']) ? $_GET['inputupdate'] : ''); $categories = (isset($_GET['categories']) ? (int)$_GET['categories'] : '0'); if (array_key_exists('discount',$_GET)) { if (is_numeric($_GET['discount'])) { $discount = (float)$_GET['discount']; } else { $discount = -1; } } else { $discount = -1; } if ($fullprice == 'yes') tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id=$productid;"); else if($inputupdate == "yes"){ $inputspecialprice = (isset($_GET['inputspecialprice']) ? $_GET['inputspecialprice'] : ''); if (substr($inputspecialprice, -1) == '%') { $productprice = (isset($_GET['productprice']) ? (float)$_GET['productprice'] : ''); $specialprice = ($productprice - (($inputspecialprice / 100) * $productprice)); } else { $specialprice = $inputspecialprice; } $alreadyspecial = tep_db_query ("SELECT * FROM " . TABLE_SPECIALS . " WHERE products_id=$productid;"); $specialproduct= tep_db_fetch_array($alreadyspecial); if ($specialproduct["specials_id"]){ //print ("Database updated. Status:".$specialproduct["status"]); tep_db_query ("UPDATE " . TABLE_SPECIALS . " SET specials_new_products_price='$specialprice' where products_id=$productid ; "); } else{ //print("New product added to specials table"); $today = date("Y-m-d H:i:s"); tep_db_query ("INSERT INTO " . TABLE_SPECIALS . " VALUES ('','$productid','$specialprice','$today','','','','1');"); } } ?> <form action="<?php echo $current_page; ?>" method="get"> <table><tr class="dataTableHeadingRow"><td class="dataTableHeadingContent" colspan="6"> <?php echo TEXT_SELECT_CAT .'&nbsp;' . tep_draw_pull_down_menu('categories', tep_get_category_tree(), $categories); echo TEXT_ENTER_DISCOUNT . ':&nbsp; '; ?> <input type="text" size="4" name="discount" value="<?php if ($discount > 0) { echo $discount; } ?>"><?php echo TEXT_PCT_AND; ?>&nbsp;&nbsp; <input type="submit" value="<?php echo TEXT_BUTTON_SUBMIT; ?>"> </form></td></tr> <tr class="dataTableContent"><td class="dataTableContent" colspan="6"> <?php echo TEXT_INSTRUCT_TITLE; ?><br /> <ul><li><?php echo TEXT_INSTRUCT_1; ?></li> <li><?php echo TEXT_INSTRUCT_2; ?></li> <li><?php echo TEXT_INSTRUCT_3; ?></li> </ul> </td></tr> <?php if ($discount == -1) { //echo 'do nothing'; } else if ($discount == 0) { $result2 = tep_db_query("select p.products_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories"); while ( $row = tep_db_fetch_array($result2) ){ $allrows[] = $row["products_id"]; } tep_db_query("DELETE FROM " . TABLE_SPECIALS . " WHERE products_id in ('".implode("','",$allrows)."');"); } else if ($discount > 0) { $specialprice = $discount / 100; $result2 = tep_db_query("select p.products_id, p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc where p.products_id=ptc.products_id and ptc.categories_id=$categories"); while ( $row = tep_db_fetch_array($result2) ){ $hello2 = $row["products_price"]; $hello3 = $hello2 * $specialprice; $hello4 = $hello2 - $hello3; $number = $row["products_id"]; $result3 = tep_db_query("select * from " . TABLE_SPECIALS . " where products_id = $number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0){ //echo "Insert into specials (products_id, specials_new_products_price) values ($number, '$hello4')"; tep_db_query("Insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price) values ($number, '$hello4'); "); } else { //echo "Update specials set specials_new_products_price='$hello4' where products_id=$number"; tep_db_query ("Update " . TABLE_SPECIALS . " set specials_new_products_price='$hello4' where products_id=$number;"); } } } print (" <tr class=\"dataTableHeadingRow\"> <td class=\"dataTableHeadingContent\">". TABLE_HEADING_PRODUCTS ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PRODUCTS_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_SPECIAL_PRICE ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_PCT_OFF ."</td> <td class=\"dataTableHeadingContent\">" . TABLE_HEADING_FULL_PRICE . "</td> </tr>"); $result2 = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc, " . TABLE_PRODUCTS . " p where pd.products_id=ptc.products_id and p.products_id=ptc.products_id and ptc.categories_id = $categories and pd.language_id = " .(int)$languages_id . " order by pd.products_name asc "); while ( $row = tep_db_fetch_array($result2) ) { $number = $row["products_id"]; $result3 = tep_db_query("SELECT * FROM " . TABLE_SPECIALS . " where products_id=$number"); $num_rows = tep_db_num_rows($result3); if ($num_rows == 0) { $specialprice = "none"; $implieddiscount = ''; } else { while ( $row2 = tep_db_fetch_array($result3) ) { $specialprice = $row2["specials_new_products_price"]; if ($row["products_price"] > 0) { $implieddiscount = '-'.(100-(($specialprice / $row["products_price"])*100)).'%'; } else { $implieddiscount = ''; } } } print("<form action=\"$current_page\" method=\"get\">"); print(" <tr class=\"dataTableRow\" onmouseover=\"rowOverEffect(this)\" onmouseout=\"rowOutEffect(this)\" > <td class=\"dataTableContent\">" . $row["products_name"] . "</td> <td class=\"dataTableContent\">" . $row["products_price"] . "</td> <td class=\"dataTableContent\"><input name=\"inputspecialprice\" type=\"text\" value=\"$specialprice\"></td> <td class=\"dataTableContent\">$implieddiscount </td> <td class=\"dataTableContent\"><input type=\"checkbox\" name=\"fullprice\" value=\"yes\"></td> <td class=\"dataTableContent\"><input type=\"hidden\" name=\"categories\" value=\"" . $categories ."\"> <input type=\"hidden\" name=\"productprice\" value=\"" . $row["products_price"] . "\"> <input type=\"hidden\" name=\"productid\" value=\"" . $row["products_id"] . "\"> <input type=\"hidden\" name=\"inputupdate\" value=\"yes\"> <input type=\"submit\" value=\"" . TEXT_BUTTON_UPDATE . "\"></td></tr></form>"); } print ("</table>"); ?> <!------------------------ Code for Specials Admin ends here ---------------------------> </td> </tr> </table> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Tks in advance for any help!
  6. Hi there. Great contribution, tks a lot! I installed it successfuly on v2.3.4, but there's a little glitch: it conflicts with image popup on product's page so nothing happens when I click to enlarge product's image. This is the part of the code that is causing the issue. It's on template_top.php. <script type="text/javascript"> $(document).ready(function(){ $('.custom_select form').jqTransform(); $("ul.sf-menu").superfish({ pathClass: 'current', delay: 1000, animation: {opacity:'show',height:'show'}, speed: 'slow', autoArrows: true, dropShadows: true }); }); </script> --> If I remove that, image pop up works fine, so does the menu, but I'm not sure if it will cause unknown issues. Can anybody help fixing that pretty pleeeease? TIA! :)
  7. OMG!! I'm so silly!! That did the trick, Tsimi! The very first part of the changes on checkout_shipping.php was wrong. There are 2 instances of if (!tep_session_is_registered('shipping')) tep_session_register('shipping'); and I located just the first one around line 60 when I should've gone for the one on line 109. To avoid this type of confusion for others maybe you should change the instructions a little bit and instead of that line of code that shows in 2 different places, maybe use this one: if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) { and add the code right ABOVE or BEFORE it. Anyway, thank you so much for your help and quick reply. Wonderful contribution, by the way! Thank you for sharing! :)
  8. Hi there. This seemed easy to install, but it's not showing on the confirmation page and not adding the fee to the total! The option shows correctly on the checkout shipping page, it's configured correctly on admin without overlapping the sort order of the other installed modules and before the total. I check the option for gift wrap, but it doesn't show on confirmation page. I revised the installation over and over again and for the life of me I cannot find anything wrong! Can somebody help, please??? I've wasted over 2 hours on this already, thinking it wouldn't take more than 15 minutes to install it and getting it working. :( I'm using normal v2.3.4. BTW, the instructions file seems to be missing stuff. The text wasn't showing correctly on the checkout shipping page, but after I used the manual upgrade instructions, it did show fine. Tks for any help here, guys! :)
  9. Patty

    Ultimate Seo Urls 5 Pro

    I was having the same problem. Saving file without BOM did it! Thank you for sharing!
  10. UPDATE: (Can't edit the post any longer) I just noticed that if I select to show 100 products per page and change anything on the first 60 products it will work fine, but the changes after the 60th product won't take place. So it's actually only saving the first 60 products. Any clues??
  11. Hi guys! :) I don't know if this is a bug nobody noticed or if it's happening just on my store. The issue is with the selection of number of products per page. If I chose anything above 60 the changes just won't take place! I mean, I change the price, click the Save button and the price stays the same. I change the number of products to 60 per page, and the changes are saved fine. Below is the current file I'm using on version 2.3.4. I've changed to other files but same thing happens with all of them, so I think it's probably a bug nobody noticed before. I'm not a programmer, so I'm not sure what's wrong with the code, but I think it has to do with line #192 (define the step for rollover lines per page). Can any of you nice guys help me with this? TIA! :) <?php /* $Id: quick_updates.php,v 2.3 2003/06/04 11:44:34 HRB Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Based on the original script contributed by Burt (burt@xwww.co.uk) and by Henri Bredehoeft (hrb@[member=nermica].net) This version was contributed by Mathieu (contact@mathieueylert.com) (http://www.oscommerce-fr.info/forums) Copyright (c) 2002 osCommerce Released under the GNU General Public License Modified by Bluestrat on 04/02/2005 to display and update cost and retail price for EZ Fields Retail Price and Margin Report Costs. If anyone is skilled enough to work in an attributes assignment drop down menu and QT pro stock tracking option, this contribution very well could be the ultimate timesaver for many OSCommerce shop owners. */ require('includes/application_top.php'); if (isset($_GET['row_by_page'])) { $row_by_page = (int)$_GET['row_by_page']; } if (isset($_GET['manufacturer'])) { $manufacturer = (int)$_GET['manufacturer']; } if (isset($_GET['sort_by'])) { $sort_by = $_GET['sort_by']; } if (isset($_GET['page'])) { $page = $_GET['page']; } //end page select fix v2.8.2 ($row_by_page) ? define('MAX_DISPLAY_ROW_BY_PAGE' , $row_by_page ) : $row_by_page = MAX_DISPLAY_SEARCH_RESULTS; define('MAX_DISPLAY_ROW_BY_PAGE' , MAX_DISPLAY_SEARCH_RESULTS ); //// Tax Row $tax_class_array = array(array('id' => '0', 'text' => NO_TAX_TEXT)); $tax_class_query = tep_db_query("select tax_class_id, tax_class_title from " . TABLE_TAX_CLASS . " order by tax_class_title"); while ($tax_class = tep_db_fetch_array($tax_class_query)) { $tax_class_array[] = array('id' => $tax_class['tax_class_id'], 'text' => $tax_class['tax_class_title']); } ////Info Row pour le champ fabriquant $manufacturers_array = array(array('id' => '0', 'text' => NO_MANUFACTURER)); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } // Display the list of the manufacturers function manufacturers_list(){ global $manufacturer; $manufacturers_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m order by m.manufacturers_name ASC"); $return_string = '<select name="manufacturer" onChange="this.form.submit();">'; $return_string .= '<option value="' . 0 . '">' . TEXT_ALL_MANUFACTURERS . '</option>'; while($manufacturers = tep_db_fetch_array($manufacturers_query)){ $return_string .= '<option value="' . $manufacturers['manufacturers_id'] . '"'; if($manufacturer && $manufacturers['manufacturers_id'] == $manufacturer) $return_string .= ' SELECTED'; $return_string .= '>' . $manufacturers['manufacturers_name'] . '</option>'; } $return_string .= '</select>'; return $return_string; } function tep_has_category_subcategories($category_id) { $child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "'"); $child_category = tep_db_fetch_array($child_category_query); if ($child_category['count'] > 0) { return true; } else { return false; } } ##// Update database switch ($HTTP_GET_VARS['action']) { case 'update' : $count_update=0; $item_updated = array(); if($HTTP_POST_VARS['product_new_model']){ foreach($HTTP_POST_VARS['product_new_model'] as $id => $new_model) { if (trim($HTTP_POST_VARS['product_new_model'][$id]) != trim($HTTP_POST_VARS['product_old_model'][$id])) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_model='" . $new_model . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_name']){ foreach($HTTP_POST_VARS['product_new_name'] as $id => $new_name) { if (trim($HTTP_POST_VARS['product_new_name'][$id]) != trim($HTTP_POST_VARS['product_old_name'][$id])) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS_DESCRIPTION . " SET products_name='" . $new_name . "' WHERE products_id=$id and language_id=" . $languages_id); tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_price']){ foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) { if ($HTTP_POST_VARS['product_new_price'][$id] != $HTTP_POST_VARS['product_old_price'][$id] && $HTTP_POST_VARS['update_price'][$id] == 'yes') { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_price='" . $new_price . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_weight']){ foreach($HTTP_POST_VARS['product_new_weight'] as $id => $new_weight) { if ($HTTP_POST_VARS['product_new_weight'][$id] != $HTTP_POST_VARS['product_old_weight'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_weight='" . $new_weight . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_quantity']){ foreach($HTTP_POST_VARS['product_new_quantity'] as $id => $new_quantity) { if ($HTTP_POST_VARS['product_new_quantity'][$id] != $HTTP_POST_VARS['product_old_quantity'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_quantity='". $new_quantity . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_manufacturer']){ foreach($HTTP_POST_VARS['product_new_manufacturer'] as $id => $new_manufacturer) { if ($HTTP_POST_VARS['product_new_manufacturer'][$id] != $HTTP_POST_VARS['product_old_manufacturer'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET manufacturers_id='" . $new_manufacturer . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_image']){ foreach($HTTP_POST_VARS['product_new_image'] as $id => $new_image) { if (trim($HTTP_POST_VARS['product_new_image'][$id]) != trim($HTTP_POST_VARS['product_old_image'][$id])) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_image='" . $new_image . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_status']){ foreach($HTTP_POST_VARS['product_new_status'] as $id => $new_status) { if ($HTTP_POST_VARS['product_new_status'][$id] != $HTTP_POST_VARS['product_old_status'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_set_product_status($id, $new_status); tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_last_modified=now() WHERE products_id='" . $id . "'"); } } } if($HTTP_POST_VARS['product_new_tax']){ foreach($HTTP_POST_VARS['product_new_tax'] as $id => $new_tax_id) { if ($HTTP_POST_VARS['product_new_tax'][$id] != $HTTP_POST_VARS['product_old_tax'][$id]) { $count_update++; $item_updated[$id] = 'updated'; tep_db_query("UPDATE " . TABLE_PRODUCTS . " SET products_tax_class_id='" . $new_tax_id . "', products_last_modified=now() WHERE products_id='" . $id . "'"); } } } $count_item = array_count_values($item_updated); if ($count_item['updated'] > 0) $messageStack->add($count_item['updated'].' '.TEXT_PRODUCTS_UPDATED . " $count_update " . TEXT_QTY_UPDATED, 'success'); break; case 'calcul' : if ($HTTP_POST_VARS['spec_price']) $preview_global_price = 'true'; break; } //// explode string parameters from preview product if($info_back && $info_back!="-") { $infoback = explode('-',$info_back); $sort_by = $infoback[0]; $page = $infoback[1]; $current_category_id = $infoback[2]; $row_by_page = $infoback[3]; $manufacturer = $infoback[4]; } //// define the step for rollover lines per page $row_bypage_array = array(array()); for ($i = 10; $i <=100 ; $i=$i+5) { $row_bypage_array[] = array('id' => $i, 'text' => $i); } require(DIR_WS_INCLUDES . 'template_top.php'); ?> <script language="javascript"> <!-- var browser_family; var up = 1; if (document.all && !document.getElementById) browser_family = "dom2"; else if (document.layers) browser_family = "ns4"; else if (document.getElementById) browser_family = "dom2"; else browser_family = "other"; function display_ttc(action, prix, taxe, up){ if(action == 'display'){ if(up != 1) valeur = Math.round((prix + (taxe / 100) * prix) * 100) / 100; }else{ if(action == 'keyup'){ valeur = Math.round((parseFloat(prix) + (taxe / 100) * parseFloat(prix)) * 100) / 100; }else{ valeur = '0'; } } switch (browser_family){ case 'dom2': document.getElementById('descDiv').innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ie4': document.all.descDiv.innerHTML = '<?php echo TOTAL_COST; ?> : '+valeur; break; case 'ns4': document.descDiv.document.descDiv_sub.document.write(valeur); document.descDiv.document.descDiv_sub.document.close(); break; case 'other': break; } } --> </script> </td> <td width="100%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" colspan="3" valign="top"><?php echo HEADING_TITLE; ?></td> </tr> <tr> <td align="left"><?php echo TEXT_DESCRIPTION; ?></td> </tr> </table></td></tr> <tr><td align="center"> <table width="100%" cellspacing="0" cellpadding="0" border="1" bgcolor="#F3F9FB" bordercolor="#D1E7EF" height="100"><tr align="left"><td valign="middle"> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr><td height="5"></td></tr> <tr align="center"> <td class="smalltext"><?php echo tep_draw_form('row_by_page', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); echo tep_draw_hidden_field( 'cPath', $current_category_id);?></td> <td class="smallText"><?php echo TEXT_MAXI_ROW_BY_PAGE . ' ' . tep_draw_pull_down_menu('row_by_page', $row_bypage_array, $row_by_page, 'onChange="this.form.submit();"'); ?></form></td> <?php echo tep_draw_form('categorie', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'manufacturer', $manufacturer); ?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_CATEGORIES . ' ' . tep_draw_pull_down_menu('cPath', tep_get_category_tree(), $current_category_id, 'onChange="this.form.submit();"'); ?></td></form> <?php echo tep_draw_form('manufacturers', FILENAME_QUICK_UPDATES, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'cPath', $current_category_id);?> <td class="smallText" align="center" valign="top"><?php echo DISPLAY_MANUFACTURERS . ' ' . manufacturers_list(); ?></td></form> </tr> </table> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <td align="center"> <table border="0" cellspacing="0"> <form name="spec_price" <?php echo 'action="' . tep_href_link(FILENAME_QUICK_UPDATES, tep_get_all_get_params(array('action', 'info', 'pID')) . "action=calcul&page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer" , 'NONSSL') . '"'; ?> method="post"> <tr> <td class="main" align="center" valign="middle" nowrap> <?php echo TEXT_INPUT_SPEC_PRICE; ?></td> <td align="center" valign="middle"> <?php echo tep_draw_input_field('spec_price',0,'size="5"'); ?> </td> <td class="smalltext" align="center" valign="middle"><?php if ($preview_global_price != 'true') { echo ' ' . tep_draw_button(IMAGE_APPLY, 'document', null, 'primary', "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer"); } else echo ' <a href="' . tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer") . '">' . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer")) . '</a>';?></td> <?php if(ACTIVATE_COMMERCIAL_MARGIN == 'true'){ echo '<td class="smalltext" align="center" valign="middle"> ' . tep_draw_checkbox_field('marge','yes','','no') . ' ' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_MARGE_INFO) . '</td>';}?> </tr> <tr> <td class="smalltext" align="center" valign="middle" colspan="3" nowrap> <?php if ($preview_global_price != 'true') { echo TEXT_SPEC_PRICE_INFO1 ; } else echo TEXT_SPEC_PRICE_INFO2;?> </td> </tr> </form> </table> </td> </tr> <tr><td height="5"></td></tr> </td></tr> <br> <table width="100%" cellspacing="0" cellpadding="0" border="0"> <tr align="center"> <form name="update" method="POST" action="<?php echo $_SERVER['PHP_SELF']."?action=update&page=". $page."&sort_by=". $sort_by ."&cPath=". $current_category_id. "&row_by_page=". $row_by_page ."&manufacturer=". $manufacturer .""; ?>"> <td class="smalltext" align="middle"><?php echo WARNING_MESSAGE; ?> </td> <?php echo "<td class=\"pageHeading\" align=\"right\">" . '<script language="javascript"><!-- switch (browser_family) { case "dom2": case "ie4": document.write(\'<div id="descDiv">\'); break; default: document.write(\'<ilayer id="descDiv"><layer id="descDiv_sub">\'); break; } --> </script>' . "</td>\n"; ?> <td align="right" valign="middle"><?php echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page'); ?></td> </tr> </table> </td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php if(DISPLAY_MODEL == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_model DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MODEL . ' ' . TEXT_DESCENDINGLY)."</a> <br>" .TABLE_HEADING_MODEL . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="left" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=pd.products_name DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRODUCTS . ' ' . TEXT_DESCENDINGLY)."</a> <br>" .TABLE_HEADING_PRODUCTS . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center" valign="middle"> <?php if(DISPLAY_STATUT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . 'OFF ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_status DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . 'ON ' . TEXT_ASCENDINGLY)."</a> <br>off / on</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center" valign="middle"> <?php if(DISPLAY_WEIGHT == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_weight DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_WEIGHT . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_WEIGHT . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="center" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center" valign="middle" width="50"> <?php if(DISPLAY_QUANTITY == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_quantity DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_QUANTITY . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_QUANTITY . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="left" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php if(DISPLAY_IMAGE == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_image DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_IMAGE . ' ' . TEXT_DESCENDINGLY)."</a> <br> " . TABLE_HEADING_IMAGE . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="left" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php if(DISPLAY_MANUFACTURER == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=manufacturers_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_MANUFACTURERS . ' ' . TEXT_DESCENDINGLY)."</a> <br> " . TABLE_HEADING_MANUFACTURERS . "</td>" ; ?> </tr> </table> </td> <td class="dataTableHeadingContent" align="left" valign="middle"> <table border="0" cellspacing="0" cellpadding="0"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_price DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer) ."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_PRICE . ' ' . TEXT_DESCENDINGLY)."</a> <br> " . TABLE_HEADING_PRICE . "</td>";?> </tr> </table> </td> <td class="dataTableHeadingContent" align="left" valign="middle"> <?php if(DISPLAY_TAX == 'true')echo " <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id ASC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_up.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_ASCENDINGLY)."</a> <a href=\"" . tep_href_link( FILENAME_QUICK_UPDATES, 'cPath='. $current_category_id .'&sort_by=p.products_tax_class_id DESC&page=' . $page.'&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer)."\" >".tep_image(DIR_WS_IMAGES . 'icon_down.gif', TEXT_SORT_ALL . TABLE_HEADING_TAX . ' ' . TEXT_DESCENDINGLY)."</a> <br>" . TABLE_HEADING_TAX . " </td> " ; ?> <td class="dataTableHeadingContent" align="center" valign="middle"></td> <td class="dataTableHeadingContent" align="center" valign="middle"></td> </tr><tr class="datatableRow"> <?php //// control string sort page if ($sort_by && !preg_match('/^[a-z][ad]$/',$sort_by)) $sort_by = 'order by '.$sort_by ; //// define the string parameters for good back preview product $origin = FILENAME_QUICK_UPDATES."?info_back=$sort_by-$page-$current_category_id-$row_by_page-$manufacturer"; //// controle length (lines per page) $split_page = (int)$_GET['page']; if ($split_page > 1) $rows = $split_page * MAX_DISPLAY_ROW_BY_PAGE - MAX_DISPLAY_ROW_BY_PAGE; //// select categories if ($current_category_id == 0){ if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and pd.language_id = '$languages_id' $sort_by "; } } else { if($manufacturer){ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by "; }else{ if(tep_has_category_subcategories($current_category_id)){//if - check subcategory existence $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id IN (select categories_id from categories where parent_id = '" . $current_category_id . "') $sort_by "; }else{ $products_query_raw = "select p.products_id, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by "; }//if - check subcategory existence } } //// page splitter and display each products info $products_split = new splitPageResults($split_page, MAX_DISPLAY_ROW_BY_PAGE, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { $rows++; if (strlen($rows) < 2) { $rows = '0' . $rows; } //// check for global add value or rates, calcul and round values rates if ($HTTP_POST_VARS['spec_price']){ $flag_spec = 'true' ; //page select fix v2.8.3 August 11, 2009 $spec_price = $HTTP_POST_VARS['spec_price']; if (substr($HTTP_POST_VARS['spec_price'],-1) == '%') { if($HTTP_POST_VARS['marge'] && substr($HTTP_POST_VARS['spec_price'],0,1) != '-'){ $valeur = (1 - (ereg_replace("%", "", $HTTP_POST_VARS['spec_price']) / 100)); $price = sprintf("%01.2f", round($products['products_price'] / $valeur,2)); }else{ $price = sprintf("%01.2f", round($products['products_price'] + (($spec_price / 100) * $products['products_price']),2)); } } else $price = sprintf("%01.2f", round($products['products_price'] + $spec_price,2)); //page select fix v2.8.3 August 11, 2009 } else $price = sprintf("%01.2f", round($products['products_price'], 2)); //// Check Tax_rate for displaying TTC $tax_query = tep_db_query("select r.tax_rate, c.tax_class_title from " . TABLE_TAX_RATES . " r, " . TABLE_TAX_CLASS . " c where r.tax_class_id=" . $products['products_tax_class_id'] . " and c.tax_class_id=" . $products['products_tax_class_id']); $tax_rate = tep_db_fetch_array($tax_query); if($tax_rate['tax_rate'] == '')$tax_rate['tax_rate'] = 0; if(MODIFY_MANUFACTURER == 'false'){ $manufacturer_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id=" . $products['manufacturers_id']); $manufacturer = tep_db_fetch_array($manufacturer_query); } //// display infos per row if($flag_spec){echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $price . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\');';} echo 'this.className=\'dataTableRow\'">'; }else{ echo '<tr class="dataTableRow" onmouseover="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'display\', ' . $products['products_price'] . ', ' . $tax_rate['tax_rate'] . ');';} echo 'this.className=\'dataTableRowOver\';this.style.cursor=\'hand\'" onmouseout="'; if(DISPLAY_TVA_OVER == 'true'){echo 'display_ttc(\'delete\', \'\', \'\', 0);';} echo 'this.className=\'dataTableRow\'">';} if(DISPLAY_MODEL == 'true'){if(MODIFY_MODEL == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"6\" name=\"product_new_model[".$products['products_id']."]\" value=\"".$products['products_model']."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $products['products_model'] . "</td>\n";}else{ echo "<td class=\"smallText\" align=\"left\">";} if(MODIFY_NAME == 'true')echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"60\" name=\"product_new_name[".$products['products_id']."]\" value=\"".str_replace("\"",""",$products['products_name'])."\"></td>\n";else echo "<td class=\"smallText\" align=\"left\">".$products['products_name']."</td>\n"; //// Product status radio button if(DISPLAY_STATUT == 'true'){ if ($products['products_status'] == '1') { echo "<td class=\"smallText\" align=\"center\"><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" ><input type=\"radio\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\" checked ></td>\n"; } else { echo "<td class=\"smallText\" align=\"center\"><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"0\" checked ><input type=\"radio\" style=\"background-color: #EEEEEE\" name=\"product_new_status[".$products['products_id']."]\" value=\"1\"></td>\n"; } }else{ echo "<td class=\"smallText\" align=\"center\"></td>"; } if(DISPLAY_WEIGHT == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"5\" name=\"product_new_weight[".$products['products_id']."]\" value=\"".$products['products_weight']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_QUANTITY == 'true')echo "<td class=\"smallText\" align=\"center\"><input type=\"text\" size=\"5\" name=\"product_new_quantity[".$products['products_id']."]\" value=\"".$products['products_quantity']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_IMAGE == 'true')echo "<td class=\"smallText\" align=\"left\"><input type=\"text\" size=\"50\" name=\"product_new_image[".$products['products_id']."]\" value=\"".$products['products_image']."\"></td>\n";else echo "<td class=\"smallText\" align=\"center\"></td>"; if(DISPLAY_MANUFACTURER == 'true'){if(MODIFY_MANUFACTURER == 'true')echo "<td class=\"smallText\" align=\"center\">".tep_draw_pull_down_menu("product_new_manufacturer[".$products['products_id']."]\"", $manufacturers_array, $products['manufacturers_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"center\">" . $manufacturer['manufacturers_name'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// get the specials products list $specials_array = array(); $specials_query = tep_db_query("select p.products_id, s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = p.products_id"); while ($specials = tep_db_fetch_array($specials_query)) { $specials_array[] = $specials['products_id']; } //// check specials if ( in_array($products['products_id'],$specials_array)) { $spec_query = tep_db_query("select s.products_id, s.specials_id from " . TABLE_PRODUCTS . " p, " . TABLE_SPECIALS . " s where s.products_id = " . (int)$products['products_id'] . ""); $spec = tep_db_fetch_array($spec_query); echo "<td class=\"smallText\" align=\"left\"> <input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" value=\"".$products['products_price']."\" disabled > <a target=blank href=\"".tep_href_link (FILENAME_SPECIALS, 'sID='.$spec['specials_id']).'&action=edit'."\">". tep_image(DIR_WS_IMAGES . 'icons/edit.gif', TEXT_SPECIALS_PRODUCTS) ."</a></td>\n"; } else { if ($flag_spec == 'true') { echo "<td class=\"smallText\" align=\"left\"> <input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_checkbox_field('update_price['.$products['products_id'].']','yes','checked','no')."</td>\n"; } else { echo "<td class=\"smallText\" align=\"left\"> <input type=\"text\" size=\"6\" name=\"product_new_price[".$products['products_id']."]\" "; if(DISPLAY_TVA_UP == 'true'){ echo "onKeyUp=\"display_ttc('keyup', this.value" . ", " . $tax_rate['tax_rate'] . ", 1);\"";} echo " value=\"".$price ."\">".tep_draw_hidden_field('update_price['.$products['products_id'].']','yes'). "</td>\n";} } if(DISPLAY_TAX == 'true'){if(MODIFY_TAX == 'true')echo "<td class=\"smallText\" align=\"left\">".tep_draw_pull_down_menu("product_new_tax[".$products['products_id']."]\"", $tax_class_array, $products['products_tax_class_id'])."</td>\n";else echo "<td class=\"smallText\" align=\"left\">" . $tax_rate['tax_class_title'] . "</td>";}else{ echo "<td class=\"smallText\" align=\"center\"></td>";} //// links to preview or full edit if(DISPLAY_PREVIEW == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&action=new_product_preview&read=only&sort_by='.$sort_by.'&page='.$split_page.'&origin='.$origin)."\">". tep_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n"; if(DISPLAY_EDIT == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".tep_href_link (FILENAME_CATEGORIES, 'pID='.$products['products_id'].'&cPath='.$categories_products[0].'&action=new_product')."\">". tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n"; //// Hidden parameters for cache old values if(MODIFY_NAME == 'true') echo tep_draw_hidden_field('product_old_name['.$products['products_id'].'] ',$products['products_name']); if(MODIFY_MODEL == 'true') echo tep_draw_hidden_field('product_old_model['.$products['products_id'].'] ',$products['products_model']); echo tep_draw_hidden_field('product_old_status['.$products['products_id'].']',$products['products_status']); echo tep_draw_hidden_field('product_old_quantity['.$products['products_id'].']',$products['products_quantity']); echo tep_draw_hidden_field('product_old_image['.$products['products_id'].']',$products['products_image']); if(MODIFY_MANUFACTURER == 'true')echo tep_draw_hidden_field('product_old_manufacturer['.$products['products_id'].']',$products['manufacturers_id']); echo tep_draw_hidden_field('product_old_weight['.$products['products_id'].']',$products['products_weight']); echo tep_draw_hidden_field('product_old_price['.$products['products_id'].']',$products['products_price']); if(MODIFY_TAX == 'true')echo tep_draw_hidden_field('product_old_tax['.$products['products_id'].']',$products['products_tax_class_id']); //// hidden display parameters echo tep_draw_hidden_field( 'row_by_page', $row_by_page); echo tep_draw_hidden_field( 'sort_by', $sort_by); echo tep_draw_hidden_field( 'page', $split_page); } echo "</table>\n"; ?> </td> </tr> </table></td> </tr> <tr> <td align="right"> <?php //// display bottom page buttons echo tep_draw_button(PRINT_TEXT, 'print', null, null, array('params' => 'onclick="window.print();"')); echo tep_draw_button(IMAGE_SAVE, 'disk', null, 'action=update&cPath=$current_category_id&page=$page&sort_by=$sort_by&row_by_page=$row_by_page'); echo '<a href="' . tep_href_link(FILENAME_QUICK_UPDATES,"row_by_page=$row_by_page") . '">' . tep_draw_button(IMAGE_CANCEL, 'close', tep_href_link(FILENAME_QUICK_UPDATES, "page=$page&sort_by=$sort_by&cPath=$current_category_id&row_by_page=$row_by_page&manufacturer=$manufacturer")) . '</a>'; $manufacturer = tep_db_prepare_input($_GET['manufacturer']); ?></td> </tr> </form> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE , $split_page, TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"> <?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_ROW_BY_PAGE, MAX_DISPLAY_PAGE_LINKS, $split_page, '&cPath='. $current_category_id .'&sort_by='.$sort_by . '&row_by_page=' . $row_by_page . '&manufacturer=' . $manufacturer); ?> </td> </table></td> </tr> </table></td> </tr> </table></td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> </tr> </table> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); ?> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  12. Patty

    Pop Up customer Stock Alert

    @@Dan Cole Hi there. Unfortunately I'm no programmer at all! I know very little of PHP, just enough to make modifications by instruction. Maybe somebody else could help? Guys??
  13. OK, I paid someone to fix this for me, since I couldn't get any help here. Anyway, here's the file that corrects not only this, but also a bug that will show the discount even if the addon was deactivated in the admin. I hope it can help someone. <?php /* <<<<<<< ot_lev_discount.php $Id: ot_lev_discount.php,v 1.0 2002/04/08 01:13:43 hpdl Exp $ ======= $Id: ot_lev_discount.php,v 1.3 2002/09/04 22:49:11 wilt Exp $ $Id: ot_lev_discount.php,v 2.4 2006/02/28 12:10:01 maniac101 Exp $ modified to calc discount correctly when tax is included in discount >>>>>>> 2.4 osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2002 osCommerce Released under the GNU General Public License */ class ot_lev_discount { var $title, $output; function ot_lev_discount() { $this->code = 'ot_lev_discount'; $this->title = MODULE_LEV_DISCOUNT_TITLE; $this->description = MODULE_LEV_DISCOUNT_DESCRIPTION; $this->enabled = MODULE_LEV_DISCOUNT_STATUS; $this->sort_order = MODULE_LEV_DISCOUNT_SORT_ORDER; $this->include_shipping = MODULE_LEV_DISCOUNT_INC_SHIPPING; $this->include_tax = MODULE_LEV_DISCOUNT_INC_TAX; $this->calculate_tax = MODULE_LEV_DISCOUNT_CALC_TAX; $this->table = MODULE_LEV_DISCOUNT_TABLE; // $this->credit_class = true; $this->output = array(); } function process() { global $order, $ot_subtotal, $currencies; $od_amount = $this->calculate_credit($this->get_order_total()); if ($od_amount > 0) { $this->deduction = $od_amount; $this->output[] = array('title' => $this->title . ':', 'text' => '<b>- ' . $currencies->format($od_amount) . '</b>', 'value' => $od_amount); $order->info['total'] = $order->info['total'] - $od_amount; if ($this->sort_order < $ot_subtotal->sort_order) { $order->info['subtotal'] = $order->info['subtotal'] - $od_amount; } } } function calculate_credit($amount) { global $order, $customer_id, $payment; $od_amount = 0; $table_pay = preg_split("/[,]/", MODULE_LEV_DISCOUNT_TYPE); $table_cost = preg_split("/[:,]/", MODULE_LEV_DISCOUNT_TABLE); if (MODULE_LEV_DISCOUNT_STATUS == "true" && (in_array($payment, $table_pay))) { for ($i = 0; $i < count($table_cost); $i+=2) { if ($amount >= $table_cost[$i]) { $od_pc = $table_cost[$i + 1]; } } // Calculate tax reduction if necessary if ($this->calculate_tax == 'true') { // Calculate main tax reduction $tod_amount = round($order->info['tax'] * 10) / 10 * $od_pc / 100; $order->info['tax'] = $order->info['tax'] - $tod_amount; // Calculate tax group deductions reset($order->info['tax_groups']); while (list($key, $value) = each($order->info['tax_groups'])) { $god_amount = round($value * 10) / 10 * $od_pc / 100; $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount; } } $od_amount = round($amount * 10) / 10 * $od_pc / 100; //$od_amount = $od_amount + $tod_amount; // maniac101 above line was adding tax back into discount incorrectly for me } return $od_amount; } function get_order_total() { global $order, $cart; $order_total = $order->info['total']; // Check if gift voucher is in cart and adjust total $products = $cart->get_products(); for ($i = 0; $i < sizeof($products); $i++) { $t_prid = tep_get_prid($products[$i]['id']); $gv_query = tep_db_query("select products_price, products_tax_class_id, products_model from " . TABLE_PRODUCTS . " where products_id = '" . $t_prid . "'"); $gv_result = tep_db_fetch_array($gv_query); // if (ereg('^GIFT', addslashes($gv_result['products_model']))) { if (preg_match('/^GIFT/', addslashes($gv_result['products_model']))) { $qty = $cart->get_quantity($t_prid); $products_tax = tep_get_tax_rate($gv_result['products_tax_class_id']); if ($this->include_tax == 'false') { $gv_amount = $gv_result['products_price'] * $qty; } else { $gv_amount = ($gv_result['products_price'] + tep_calculate_tax($gv_result['products_price'], $products_tax)) * $qty; } $order_total = $order_total - $gv_amount; } } if ($this->include_tax == 'false') $order_total = $order_total - $order->info['tax']; if ($this->include_shipping == 'false') $order_total = $order_total - $order->info['shipping_cost']; return $order_total; } function check() { if (!isset($this->check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_LEV_DISCOUNT_STATUS'"); $this->check = tep_db_num_rows($check_query); } return $this->check; } function keys() { return array('MODULE_LEV_DISCOUNT_STATUS', 'MODULE_LEV_DISCOUNT_SORT_ORDER', 'MODULE_LEV_DISCOUNT_TABLE', 'MODULE_LEV_DISCOUNT_TYPE', 'MODULE_LEV_DISCOUNT_INC_SHIPPING', 'MODULE_LEV_DISCOUNT_INC_TAX', 'MODULE_LEV_DISCOUNT_CALC_TAX'); } 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 ('Display Total', 'MODULE_LEV_DISCOUNT_STATUS', 'true', 'Do you want to enable the Order Discount?', '6', '1','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 ('Sort Order', 'MODULE_LEV_DISCOUNT_SORT_ORDER', '999', 'Sort order of display.', '6', '2', 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 ('Include Shipping', 'MODULE_LEV_DISCOUNT_INC_SHIPPING', 'true', 'Include Shipping in calculation', '6', '3', '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, set_function ,date_added) values ('Include Tax', 'MODULE_LEV_DISCOUNT_INC_TAX', 'true', 'Include Tax in calculation.', '6', '4','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, set_function ,date_added) values ('Calculate Tax', 'MODULE_LEV_DISCOUNT_CALC_TAX', 'false', 'Re-calculate Tax on discounted amount.', '6', '5','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 ('Discount Percentage', 'MODULE_LEV_DISCOUNT_TABLE', '100:7.5,250:10,500:12.5,1000:15', 'Set the price breaks and discount percentages', '6', '6', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Formas de pagamento com desconto', 'MODULE_LEV_DISCOUNT_TYPE', 'transferencia', 'Digite as formas de pagamento que qualificam para o desconto (separar por vírgula): cc, cheque, cop, pagamentodigital, pagseguro, paypal_direct, paypal_express, paypal_standart, transferencia, transfer_cef, transfer_bb, transfer_bradesco, transfer_itau, transfer_unibanco, transfer_real, transfer_santander, transfer_hsbc, west', '6', '7', now())"); } function remove() { $keys = ''; $keys_array = $this->keys(); for ($i = 0; $i < sizeof($keys_array); $i++) { $keys .= "'" . $keys_array[$i] . "',"; } $keys = substr($keys, 0, -1); tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")"); } } ?>
  14. Patty

    Pop Up customer Stock Alert

    If you think it's the best way, I agree with you. ;)
  15. Patty

    Pop Up customer Stock Alert

    Tks for your reply, Dan. Validation would be nice and would probably take care of these issues. Do you know how to do it?
×