Jump to content

zoran23

Members
  • Content count

    5
  • Joined

  • Last visited

Profile Information

  • Real Name
    Zoran

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. zoran23

    Simply Hide Products (SHP)

    Hi Gerhard Thank you for this great contribution, I am using it from your first upload and it is working exactly as it should. I agree with you that was not easy to select and deselect multiple customers when there is a large number of customers in the store and i was happy when i sow your last addition to overcome this problem. Unfortunately it looks like your installation instruction is not 100% accurate . You are uploading these new files 1. Upload the following new files /catalog/admin/includes/javascript/jquery.multi-select.js /catalog/admin/includes/javascript/jquery.quicksearch.js /catalog/admin/includes/javascript/jquery-1.11.3.min.js /catalog/admin/includes/javascript/multi-select.css /catalog/admin/images/icons/switch.png And in File: /catalog/admin/includes/template_top.php you are having references for the only following files: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx File: /catalog/admin/includes/template_top.php xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <link rel="stylesheet" type="text/css" href="<?php echo tep_catalog_href_link('admin/includes/javascript/multi-select.css', '', 'SSL'); ?>"> <script type="text/javascript" src="<?php echo tep_catalog_href_link('admin/includes/javascript/jquery.multi-select.js', '', 'SSL'); ?>"></script> <script type="text/javascript" src="<?php echo tep_catalog_href_link('admin/includes/javascript/jquery.quicksearch.js', '', 'SSL'); ?>"></script> I wonder if this is needed : /catalog/admin/includes/javascript/jquery-1.11.3.min.js IN tis file xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx File: /catalog/admin/includes/functions\general.php xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx You have replaced flowing code /Simply Hide Product (SHP) function tep_print_shp_menu($menu_type = 'article') { $cont .= ""; if($menu_type != 'article' && $menu_type != 'category') { $cont .= "Wrong Menu-Type defined!"; return $cont; } if(!defined(SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS)) { $txt_menu = SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS;} else { $txt_menu = 'SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS';} if(!defined(SHP_ARTICLE_VISIBLE_TO_CUSTOMERS)) { $txt_customers = SHP_ARTICLE_VISIBLE_TO_CUSTOMERS; } else { $txt_customers = 'SHP_ARTICLE_VISIBLE_TO_CUSTOMERS';} if($menu_type == 'category') { if(!defined(SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS)) { $txt_menu = SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS; } else { $txt_menu = 'SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS';} if(!defined(SHP_CATEGORY_VISIBLE_TO_CUSTOMERS)) { $txt_customers = SHP_CATEGORY_VISIBLE_TO_CUSTOMERS; } else { $txt_customers = 'SHP_CATEGORY_VISIBLE_TO_CUSTOMERS';} } if($menu_type == 'category') { $cont .= '<table><tr> <td class="main" valign="top">'.$txt_menu.'<br>'; } else { $cont .= '<tr> <td class="main" style="width: 230px" valign="top">'.$txt_menu.'</span></td> <td class="main" colspan="2">'.tep_draw_separator('pixel_trans.gif', '24', '15'); } $cont .= '<select name="shpcustomers[]" multiple="multiple" size="5" style="width: 465px"> <option selected="" value="0">'.SHP_CHOOSE_CUSTOMERS.'</option>'; $query = tep_db_query("SELECT c.customers_id, a.entry_company, a.entry_firstname, a.entry_lastname, a.entry_city FROM ".TABLE_CUSTOMERS." c, ".address_book." a WHERE c.customers_default_address_id = a.address_book_id ORDER BY entry_company, entry_lastname"); if (tep_db_num_rows($query) > 0) { while($row = tep_db_fetch_array($query)) { $txt = ""; if(!empty($row['entry_company'])) { $txt = $row['entry_company'].", "; } $txt .= $row['entry_lastname'].", ".$row['entry_firstname'].", ".$row['entry_city']; $cont .= '<option value="'.$row['customers_id'].'">'.$txt.'</option>'; } } $cont .= '</select> </td> </tr>'; $query_id = "categories_id = '".(int)$_GET['cID']."'"; if($menu_type == 'article') { $query_id = "products_id = '".(int)$_GET['pID']."'"; } $query = tep_db_query("SELECT hp.hidden_products_id, c.customers_id, a.entry_company, a.entry_firstname, a.entry_lastname, a.entry_city FROM ".TABLE_CUSTOMERS." c, ".address_book." a, hidden_products hp WHERE hp.customers_id = c.customers_id AND c.customers_default_address_id = a.address_book_id AND ".$query_id." ORDER BY entry_company, entry_lastname"); if (tep_db_num_rows($query) > 0) { if($menu_type == 'category') { $cont .= '<tr> <td class="main" valign="top">'.$txt_customers.'<br> <table style="width: 100%;" cellspacing="0"> <tbody>'; } else { $cont .= '<tr> <td class="main" style="width: 230px" valign="top">'.$txt_customers.'</td> <td class="main"><table style="width: 100%;" cellspacing="0"> <tbody>'; } while($row = tep_db_fetch_array($query)) { $txt = ""; if(!empty($row['entry_company'])) { $txt = $row['entry_company'].", "; } $txt .= $row['entry_lastname'].", ".$row['entry_firstname'].", ".$row['entry_city']; $cont .= '<tr>'; if($menu_type == 'article') { $cont .= '<td class="main" style="width: 26px">'.tep_draw_separator('pixel_trans.gif', '26', '15').'</td>'; } $cont .= '<td class="main" bgcolor="#ebebff"> '.$txt.'</td> <td class="main" valign="middle" style="width: 20;" bgcolor="#ebebff"> <input name="shpcheckbox_'.$row['hidden_products_id'].'" type="checkbox"></td> <td bgcolor="#ebebff" class="main" valign="middle" style="width: 50;"> '.SHP_DELETE_CUSTOMERS.'</td> </tr>'; } $cont .= '</tbody></table></td></tr>'; } if($menu_type == 'category') { $cont .= "</table>"; } return $cont; } With this one //Simply Hide Product SHP) function tep_print_shp_menu($menu_type = 'article') { $cont .= ""; if($menu_type != 'article' && $menu_type != 'category') { $cont .= "Wrong Menu-Type defined!"; return $cont; } if(!defined(SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS)) { $txt_menu = SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS;} else { $txt_menu = 'SHP_ARTICLE_VISIBLE_NEW_CUSTOMERS';} if($menu_type == 'category') { if(!defined(SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS)) { $txt_menu = SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS; } else { $txt_menu = 'SHP_CATEGORY_VISIBLE_NEW_CUSTOMERS';} } if($menu_type == 'category') { $cont .= '<table><tr> <td class="main" valign="top">'.$txt_menu.'<br>'; } else { $cont .= '<tr> <td class="main" style="width: 230px" valign="top">'.$txt_menu.'</span></td> <td class="main" colspan="2">'.tep_draw_separator('pixel_trans.gif', '24', '15'); } $cont .= '<select id="shp_customers" name="shpcustomers[]" multiple="multiple">'; $query_id = "categories_id = '".(int)$_GET['cID']."'"; if($menu_type == 'article') { $query_id = "products_id = '".(int)$_GET['pID']."'"; } $query = tep_db_query("SELECT c.customers_id, a.entry_company, c.customers_firstname, c.customers_lastname FROM ".TABLE_CUSTOMERS." c, ".address_book." a WHERE c.customers_default_address_id = a.address_book_id and c.customers_id NOT IN (SELECT hidden_products.customers_id FROM " . TABLE_HIDDEN_PRODUCTS . " WHERE ".$query_id.") ORDER BY customers_lastname, customers_firstname"); $query_selected = tep_db_query("SELECT c.customers_id, hp.hidden_products_id, a.entry_company, c.customers_firstname, c.customers_lastname FROM " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a, " . TABLE_HIDDEN_PRODUCTS . " hp WHERE hp.customers_id = c.customers_id AND c.customers_default_address_id = a.address_book_id AND ".$query_id." ORDER BY customers_lastname, customers_firstname"); if (tep_db_num_rows($query_selected) > 0) //fill the right part - selected customers { while($row = tep_db_fetch_array($query_selected)) { $txt = ""; $txt .= $row['customers_lastname']." ".$row['customers_firstname']; if(!empty($row['entry_company'])) { $txt .= ", ".$row['entry_company']; } $cont .= '<option value="'.$row['customers_id'].'" selected>'.$txt.'</option>'; } } if (tep_db_num_rows($query) > 0) // fill the left part - unselected customers { while($row = tep_db_fetch_array($query)) { $txt = ""; $txt .= $row['customers_lastname']." ".$row['customers_firstname']; if(!empty($row['entry_company'])) { $txt .= ", ".$row['entry_company']; } $cont .= '<option value="'.$row['customers_id'].'" >'.$txt. '</option>'; } } $cont .= '</select> </td> </tr>'; $query_id = "categories_id = '".(int)$_GET['cID']."'"; if($menu_type == 'article') { $query_id = "products_id = '".(int)$_GET['pID']."'"; } if($menu_type == 'category') { $cont .= "</table>"; } return $cont; } Doing this check box to delete hidden product disappears and I do not see any possibility to search or select multiple In order to be able to delete hidden products I had to stick to you old code on this page. Without option to search. Kind regards and big thanks for your hidden product contribution. Zoran
  2. zoran23

    Simply Hide Products (SHP)

    Hi Pronux , this contribution is just great. When I tested it I have got the same error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where categories_id not in(113, 112)' at line 1 Select count(*) as count, parent_id from categories GROUP BY parent_id where categories_id not in(113, 112) Then I found out that I am using category_css menu contribution for STS which is causing problem . If I use category.php instead of category_css.php everything works jus fine. I wonder if there is any way to have my categery_css together with this beautiful contribution. Here is how this file looks like. <?php /* $Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ ?> <?php // cssMenu - Begin of configuration // $cssMenuConfig = array(); $cssMenuConfig['ShowEmptyCategories'] = true; $cssMenuConfig['includeProducts'] = false; // Should CSSMenu show products $cssMenuConfig['maxProductsInMenu'] = 8; // Maximum number of products to show in a menu ( stops massive menus being created ) $cssMenuConfig['moreText'] = "More...."; // Maximum number of products to show in a menu ( stops massive menus being created ) $cssMenuConfig['showSubMenu'] = true; // Show category dependent menu // $cssMenuConfig['idSubMenu'] = array('619', '620'); // Category id for the dependent menu // cssMenu - End of configuration // $categories_subs = array(); $categories_start = array(); $categories_subs_query = tep_db_query("select count(*) as count, parent_id from " . TABLE_CATEGORIES . " GROUP BY parent_id"); while($row = tep_db_fetch_array($categories_subs_query)) { $categories_subs[$row['parent_id']] = $row['count']; } $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . $languages_id . "' order by sort_order, cd.categories_name"); while($row = tep_db_fetch_array($categories_query)) { $categories_start['S_' . $row['categories_id'] . '_' . $row['parent_id'] . '_E'] = $row; } ?> <script type="text/javascript"> //SuckerTree Vertical Menu (Aug 4th, 06) //By Dynamic Drive: http://www.dynamicdrive.com/style/ var menuids=["suckertree1"] //Enter id(s) of SuckerTree UL menus, separated by commas function buildsubmenus(){ for (var i=0; i<menuids.length; i++){ var ultags=document.getElementById(menuids).getElementsByTagName("ul") for (var t=0; t<ultags.length; t++){ ultags[t].parentNode.getElementsByTagName("a")[0].className="subfolderstyle" ultags[t].parentNode.onmouseover=function(){ this.getElementsByTagName("ul")[0].style.display="block" } ultags[t].parentNode.onmouseout=function(){ this.getElementsByTagName("ul")[0].style.display="none" } } } } if (window.addEventListener) window.addEventListener("load", buildsubmenus, false) else if (window.attachEvent) window.attachEvent("onload", buildsubmenus) </script> <?php function PrintProducts( $category_id, $categories_string , $includeul, $languageID) { global $cssMenuConfig; $product_path="product_info.php?cPath=".$category_id."&products_id="; $products_query = tep_db_query("select pc.products_id, pc.categories_id from products_to_categories pc, products p where pc.categories_id = " . $category_id . " and p.products_id = pc.products_id and products_status=1 order by products_price"); $productsDisplay=mysql_num_rows( $products_query ); $addMore= false; if ( $includeul && $productsDisplay > 0 ) { $returnval .= "<ul>"; } if ( $productsDisplay > $cssMenuConfig['maxProductsInMenu'] ) { $productsDisplay=$cssMenuConfig['maxProductsInMenu']; $addMore= true; } $count_string = ''; if (SHOW_COUNTS == 'true') { if ($totalitemsincategory > 0) { $count_string = ' (' . $totalitemsincategory . ')'; } } $i=0; while ($i < $productsDisplay) { $products = tep_db_fetch_array($products_query); $product_query = tep_db_query("select products_name from products_description where products_id = " . $products['products_id'] . " AND language_id = ".$languageID ); $product = tep_db_fetch_array($product_query); $returnval .= "<li><a href='".$product_path.$products['products_id']."'>".$product['products_name']."</a></li>\n"; $i++; } if ( $addMore ) { $returnval .= "<li><a href='".$categories_string."'>".$cssMenuConfig['moreText']."</a></li>\n"; } if ( $productsDisplay > 0 || !$includeul ) { $returnval .= "</ul>"; } return $returnval; } function PrintSubMenus( $parentID, $languageID, $start_path ){ global $cssMenuConfig, $categories_subs, $categories_start; $returnval = ''; if (($start_path == '') && ($parentID > 0)) { $start_path = $parentID; } else { if ($parentID > 0) $start_path .= "_" . $parentID; } if ($parentID != 0) { $returnval .= "<ul>"; } else { $returnval .= "<div class='suckerdiv'>"; $returnval .= "<ul id='suckertree1'>"; } // $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '".$parentID."' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languageID ."' order by sort_order, cd.categories_name"); $cat_subs = array(); foreach($categories_start as $key => $value) { if(strstr($key, '_' . $parentID . '_E')) { $cat_subs[$parentID][] = substr($key, 2, strpos($key, "_", 2) - 2); } } // if (!isset($_GET['cPath'])) { foreach ($cat_subs[$parentID] as $v) { //$categories = tep_db_fetch_array($categories_query) $categories = $categories_start['S_' . $v . '_' . $parentID . '_E']; if ($start_path == "") { $grouppath = $categories['categories_id']; } else { $grouppath = $start_path . "_" . $categories['categories_id']; } $cPath_new = 'cPath=' . $grouppath; $categories_string = tep_href_link(FILENAME_DEFAULT, $cPath_new); $totalitemsincategory = tep_count_products_in_category($categories['categories_id']); $count_string = ''; if ((SHOW_COUNTS == 'true') && ($totalitemsincategory > 0) ){ $count_string = ' (' . $totalitemsincategory . ')'; } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "<li><a href='".$categories_string."'>".$categories['categories_name'].$count_string."</a>\n"; } if (array_key_exists($categories['categories_id'], $categories_subs)) { //tep_has_category_subcategories($categories['categories_id']) $returnval .= PrintSubMenus( $categories['categories_id'], $languageID, $start_path ); if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, false, $languageID); } } else { if ( $cssMenuConfig['includeProducts'] ) { $returnval .= PrintProducts($categories['categories_id'],$categories_string, true, $languageID); } } if (cssMenu_ShowCategory($cssMenuConfig['ShowEmptyCategories'], $totalitemsincategory)) { $returnval .= "</li>"; } } // } if ( !$cssMenuConfig['includeProducts'] ) { $returnval .= "</ul>"; } if ($parentID == 0) $returnval .= "</div>"; return $returnval; } function cssMenu_ShowCategory( $switch, $products) { if ( $switch == 1 ) { return true; } else { if ($products > 0) { return true; } else { return false; } } } ?> <!-- categories //--> <tr> <td> <?php $info_box_contents = array(); $info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES); new infoBoxHeading($info_box_contents, true, false); $info_box_contents = array(); $info_box_contents[] = array('text' => PrintSubMenus( 0, $languages_id, '' )); new infoBox($info_box_contents); ?> </td> </tr> <!-- MenuConfigategories_eof //-->
  3. zoran23

    [Contribution] Option Types v2

    It worked out very well , but attributes disappearing when quantity is updated in shopping cart.
  4. zoran23

    [Contribution] Option Types v2

    It worked well . Thanks a lot.
  5. zoran23

    [Contribution] Option Types v2

    HTTP Server: Microsoft-IIS/6.0 PHP Version:5.2.3 (Zend: 2.2.0) Databas: MySQL 5.0.45 PHPMyAdmin 3.1.3.1 It says : Temporary Uploads folder is automatically cleaned. How old the files must be for deletion, can be set via Admin. When i go in Admin and open Option Types ther is nothing there to be set. Title, Value, Action. Everything is emty. Whot i did wrong ??? Help "" Contribution is just beutiful. Great Thanks !!!
×