Jump to content

De Dokta

Members
  • Content count

    329
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by De Dokta

  1. One can do that, of course. But I like it like that! De gustibus non est disputandum. :D
  2. De Dokta

    Automatic Supplier Order

    Hi, I don't know an addon which does this. But it's no big thing to add another tep_mail to the checkout_process.php (where the mail to your customer is generated) to send an order to your supplier. Collect the data that your supplier needs to fulfill your order, put them into the tep_mail string and then your supplier automatically gets an order whenever a customer orders something in your store. That's quite simple if you have only one supplier - with several suppliers it would be a little bit more complicated, but not impossible. J.J.
  3. Hi, found in the BS version some bugs which appear only in IE (of course - where else! :wacko:) : I could fix the image bug by changing in shopping_cart.php: $products_name .= ' <td valign="top" align="center"><a href="' . tep_href_............. to: $products_name .= ' <td width="20%" valign="top" align="center"><a href="' . tep_href_ But so far I found no solution for the strange behavior of the breadcrumb. On mouseover the breadcrumb elements move into the correct position, but on reload or if I go to another page, the phenomenon is back. Any ideas? J.J.
  4. Hi, if you want to use a variable osc must know it! ;) A simple solution: Open admin\includes\classes\order.php, add customers_id to the order_query (~line 27). Now change (~line 47) $this->customer = array('name' => $order['customers_name'],................. to: $this->customer = array('customers_id' => $order['customers_id'], 'name' => $order['customers_name'],..................... Now you can use this variable where ever you have called the class order(within the admin): echo $order->customer[customers_id']; BTW: I wonder what the $orders_query in your code above is good for? If you have the $oID you have the orders_id and then you don't need a query for it. :unsure: J.J.
  5. De Dokta

    I want to skip "What's In Your Cart"

    Hi, you can deactivate the redirect to the shopping cart in admin => configuration => my store => Display Cart After Adding Product = false. Or if you want to redirect your customer for example to the checkout_shipping immediatly after he clicked the buy button: Open includes/application_top.php, search for: $goto = FILENAME_SHOPPING_CART; and change it to: $goto = FILENAME_CHECKOUT_SHIPPING; J.J.
  6. Ahhh I see - a lot of ways to configure that for different needs.. :thumbsup:
  7. Nice! Two things: 1.) Toggling the carets does not work for me. 2.) I can not directly call categories which have subs. For example: if I click on DVD movies, the subcategories menu opens - if I click again, the sub menu is closed - but there is no way to open the DVD movies site. Is that intended? J.J.
  8. @@Tsimi No, I couldn't reproduce this error. :unsure: After Mort-Lemur reported this problem I tested several payment moduls - they all worked without any problems. I have no idea how this changes could have implications on payment modules at all!? BTW: These days we discussed in the German forum to replace the old functions in seo.class.php by the default osc tep_db_ functions. This can be done but requires further changes of the installation functions, while the replacement of mysql_ by mysqli_ does not require further modifications. The easiest way is what I have done - the best way probably would be to use the tep_db_ functions.... :- J.J.
  9. De Dokta

    ULTIMATE Seo Urls 5 - by FWR Media

    @@Tsimi Hi Lambros, are you sure that you are running this SEO tool? I can't find a seo.class.php in this addon, but in this one: Ultimate SEO URLs. Solution for that: http://forums.oscommerce.com/topic/154166-contribution-ultimate-seo-urls-v21-by-chemo/page-345#entry1692222 (and following) J.J.
  10. De Dokta

    Invoice Editor 1.0

    @@ArtcoInc Also using 234bs I can't confirm that. If I change as proposed the code I get an error - while without this change the popup works without any problems. Does this popup - where you are asked to confirm overwriting an existing invoice - not work with you? J.J.
  11. @@ArtcoInc Sorry for the confusion - me culpa maxima! I posted here the code just on the fly, to avoid having to constantly write emails. The initial idea was to use the menu box only in full view, in the collapsed view, however, the categories menu in header navbar. In collapsed view, the categories menu slips pretty far down, what I find awkward. This was the reason for the two tags "hidden-xs hidden-sm" here. J.J.
  12. Hi gadlols JS works perfectly, but the look of the categories menu needs some further cosmetics :D . To align the +/- buttons and to get a nice hover bar I added another <div class="light"> to the function in html_output.php: function tep_show_tree_box($root_id = 0,$mainUlClass='navMain nav-list',$submenuUlClass='navMain nav-list collapse'){ global $languages_id,$cPath_array, $datas; $categories_query = tep_db_query("select c.categories_id, c.categories_status, c.sort_order, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_status = '1' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by c.sort_order, cd.categories_name"); $items = array(); while ($categories = tep_db_fetch_array($categories_query)) { $items[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'id' => $categories['categories_id']); } $citems=count($items); if($citems<=0) return ''; elseif($citems==1) $children[] = $items; //in case we have one category item without subcategories, rare but possible else foreach( $items as $item ) $children[$item['parent_id']][] = $item; $loop = !empty( $children[$root_id] ); $parent = $root_id; $parent_stack = array(); $stack=array();//helper array so to know the current level $pic=''; //products_in_category string // MAINMENU $datas .='<ul class="'.$mainUlClass.'">'; while ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) ){ if ( $option === false ){ $parent = array_pop( $parent_stack ); $datas .= '</ul>'; $datas .= '</li>'; array_pop( $stack ); }elseif ( !empty( $children[$option['value']['id']] ) ){ $stack[]=$option['value']['id']; $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new=count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack); $datas .= '<li><div class="light"><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'">'; $sm=0; if((isset($cPath_array) && in_array($option['value']['id'], $cPath_array))){ $sm=1; $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='<a href="" class="switch"><span class="glyphicon glyphicon-plus-sign '.($sm==1?'glyphicon-minus-sign':'').'"></span></a></div>'; // SUBMENU $datas .= '<ul class="'.$submenuUlClass.' '.($sm==1?'in':'').' ">'; $parent_stack[]=$option['value']['parent_id']; $parent = $option['value']['id']; }else{ $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new= count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack).'_'.$option['value']['id']; $datas .= '<li><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'" >'; if (isset($cPath_array) && in_array($option['value']['id'], $cPath_array)) { $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='</a></li>'; } } $datas .='</ul>'; return $datas; } Then I added this <div> also to the JS function in footer.php: $(function(){$(".nav-list > li > div >a.switch, .nav-list > li > div >a.switch span").on("click",function(e){var sibs=$(this).closest('li').siblings();sibs.find('ul.in').collapse('hide');sibs.find('a.switch span').removeClass('glyphicon-minus-sign');$(this).closest('li').find('ul:first').collapse('toggle');if($(this).hasClass('glyphicon')) $(this).toggleClass('glyphicon-minus-sign');return false;});}); And at last some css in the user.css: /* BOF CATEGORIES BOX */ .navMain { padding-left: 0; margin-bottom: 0; list-style: none; } .navMain > li { position: relative; display: block; } .navMain > li > a { position: relative; display: inline-block; padding: 5px; } .navMain > li > a:hover, .navMain > li > a:focus { background-color: #F9CFD2; color: #B70F43; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -opera-border-radius: 5px; -khtml-border-radius: 5px; width: 100%; } .navMain > li.disabled > a { color: #999; } .navMain > li.disabled > a:hover, .navMain > li.disabled > a:focus { color: #999; text-decoration: none; cursor: not-allowed; background-color: transparent; } .navMain .open > a, .navMain .open > a:hover, .navMain .open > a:focus { background-color: #eee; border-color: #428bca; } a.switch { float:right; margin-right:20px; } .light { padding: 5px } .light:hover { background-color: #F9CFD2; color: #B70F43; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -opera-border-radius: 5px; -khtml-border-radius: 5px; } .nav-list.collapse{ padding-left:20px; } /* EOF CATEGORIES BOX */ If you like a smooth transition, the last entry in user.css should read: .nav-list.collapse{ padding-left:20px; transition: all 0.3s ease-out 0s; -webkit-transition: all 0.3s ease-out 0s; -moz-transition: all 0.3s ease-out 0s; -ms-transition: all 0.3s ease-out 0s; -o-transition: all 0.3s ease-out 0s; } (Thanks to Tsimi for that :) ) And the result looks like this: J.J.
  13. Hi PWA does not mean not to raise any data of your customers, but that no account is created and the personal data will be deleted after processing the order. PWA or not PWA - what you always need is some data to communicate with your customers (email) and to send them the sold items (address). What other data else you want to know from your customer is up to you to decide: Go to admin => configuration => customer details and set all the customers details to false which you don't want to ask. The telephone number you can directly deactivate in admin => modules => content => login without account form. Then only name, address and email remain on account_pwa.php to enter. => Purchase without account Your introduction text....Change in includes/languages/english/modules/content/login/cm_pwa_login.php My god, how do I make it actually more foolproof? Open catalog/includes/languages/english/modules/content/login/cm_pwa_login.php and enter the your text to read on the login page for the module! By the way: If you are not happy with PWA you can give Better Checkout by mattjt83 a try - demo here. It's a very fine solution, but you have to pay for it. J.J.
  14. And another observation.... In template_top.php one can find: <meta charset="utf-8"> <meta charset=<?php echo CHARSET; ?>> which results in html in: <meta charset="utf-8"> <meta charset=utf-8> Is there any reason for that double entry? J.J.
  15. De Dokta

    Wishlist for 2.3 - Problem with emails

    @@Mort-lemur Hi I remember the issue with the T&C attachments :D . Generally I would never recommend to replace any of the default functions of osc by a new one since this could have unexpected implications elsewhere in the shop. It is always better to leave the existing function untouched and simply to add a possibly required additional function. J.J.
  16. I do not know if it's bootstrap specific or generally for css applies: When I wanted to change my breadcrumb separator, I have thoroughly tested the usual html entities in all known variants, but none of them worked! Apart from the hardcoded version Unicode seems to be the only working solution - in any case the only one I could find........ J.J.
  17. Hi add to the user.css: .breadcrumb > li + li:before { content: ">>"; } or if you prefer unicode: .breadcrumb > li + li:before { content:"\003E \003E"; } J.J.
  18. Yes, I missed the user.css too! But no problem - create a new one (or copy it from your previous BS2334) and add an entry to your template_top.php after <link href="custom.css" rel="stylesheet"> <link href="user.css" rel="stylesheet"> I think it was a very good idea of burt to say "Keep the core including the custom.css untouched and write all your style changes into the user.css". This way you can simply transfer your styles from shop to shop and also very simply restore the original state of BS2334. J.J.
  19. Ok once again. Case 1: Click function (which I prefer) general.php: function tep_show_tree_box($root_id = 0,$mainUlClass='nav nav-list group',$submenuUlClass='nav nav-list submenu group',$mainUlId='accordion'){ global $languages_id,$cPath_array, $datas; $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='" . (int)$languages_id ."' order by sort_order, cd.categories_name"); $items = array(); while ($categories = tep_db_fetch_array($categories_query)) { $items[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'id' => $categories['categories_id']); } $citems=count($items); if($citems<=0) return ''; elseif($citems==1) $children[] = $items; //in case we have one category item without subcategories, rare but possible else foreach( $items as $item ) $children[$item['parent_id']][] = $item; $loop = !empty( $children[$root_id] ); $parent = $root_id; $parent_stack = array(); $stack=array();//helper array so to know the current level $pic=''; //products_in_category string $datas .='<ul class="'.$mainUlClass.'" id="' . $mainUlId . '">'; while ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) ){ if ( $option === false ){ $parent = array_pop( $parent_stack ); $datas .= '</ul>'; $datas .= '</li>'; array_pop( $stack ); }elseif ( !empty( $children[$option['value']['id']] ) ){ $stack[]=$option['value']['id']; $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new=count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack); $datas .= '<li><a class="trigger right-caret" href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'">'; $sm=0; if((isset($cPath_array) && in_array($option['value']['id'], $cPath_array))){ $sm=1; $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='</a>'; $datas .= '<ul class="'.$submenuUlClass.'">'; $parent_stack[]=$option['value']['parent_id']; $parent = $option['value']['id']; }else{ $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new= count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack).'_'.$option['value']['id']; $datas .= '<li><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'" >'; if (isset($cPath_array) && in_array($option['value']['id'], $cPath_array)) { $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='</a></li>'; } } $datas .='</ul>'; $datas .='</div>'; return $datas; } You don't need a $submenuUlId='accordion' - once the id is set, it's set for the whole menu! I also removed the navWrapper - no idea what it was good for. footer.php: <script type="text/javascript"> $('#accordion').dcAccordion({ eventType : 'click', // Event for activating menu - options are "click" or "hover" hoverDelay : 0, // Hover delay for hoverIntent plugin menuClose : false, // If set "true" with event "hover" menu will close fully when mouseout autoClose : true, // If set to "true" only one sub-menu open at any time autoExpand : false, // If set to "true" all sub-menus of parent tags with class 'classExpand' will expand on page load speed : 'slow', // Speed of animation saveState : true, // Save menu state using cookies disableLink : false, // Disable all links of parent items showCount : false, // If "true" will add a count of the number of links under each parent menu item cookie : 'dcjq-accordion', // Sets the cookie name for saving menu state - each menu instance on a single page requires a unique cookie name. saveState : true // Save menu state using cookies }); $(".nav-list > li > a.trigger").one("click",function(e){e.preventDefault(); var current=$(this).next(); var grandparent=$(this).parent().parent(); if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))$(this).toggleClass('right-caret left-caret'); grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret'); });$(".nav-list > li > a:not(.trigger)").one("click",function(){var root=$(this).closest('.nav-list');root.find('.left-caret').toggleClass('right-caret left-caret');});(jQuery); </script> jquery.dcjqaccordion.2.7.min.js: (function($){ $.fn.dcAccordion = function(options) { //set default options var defaults = { classParent : 'dcjq-parent', classActive : 'active', classArrow : 'dcjq-icon', classCount : 'dcjq-count', classExpand : 'dcjq-current-parent', eventType : 'click', hoverDelay : 300, menuClose : true, autoClose : true, autoExpand : false, speed : 'slow', saveState : true, disableLink : true, showCount : false, cookie : 'dcjq-accordion' }; //call in the default otions var options = $.extend(defaults, options); this.each(function(options){ var obj = this; setUpAccordion(); if(defaults.saveState == true){ checkCookie(defaults.cookie, obj); } if(defaults.autoExpand == true){ $('li.'+defaults.classExpand+' > a').addClass(defaults.classActive); } resetAccordion(); if(defaults.eventType == 'hover'){ var config = { sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) interval: defaults.hoverDelay, // number = milliseconds for onMouseOver polling interval over: linkOver, // function = onMouseOver callback (REQUIRED) timeout: defaults.hoverDelay, // number = milliseconds delay before onMouseOut out: linkOut // function = onMouseOut callback (REQUIRED) }; $('li a',obj).hoverIntent(config); var configMenu = { sensitivity: 2, // number = sensitivity threshold (must be 1 or higher) interval: 1000, // number = milliseconds for onMouseOver polling interval over: menuOver, // function = onMouseOver callback (REQUIRED) timeout: 1000, // number = milliseconds delay before onMouseOut out: menuOut // function = onMouseOut callback (REQUIRED) }; $(obj).hoverIntent(configMenu); // Disable parent links if(defaults.disableLink == true){ $('li a',obj).one('click',function(e){ if($(this).siblings('ul').length >0){ e.preventDefault(); } }); } } else { $('li a',obj).one('click',function(e){ $activeLi = $(this).parent('li'); $parentsLi = $activeLi.parents('li'); $parentsUl = $activeLi.parents('ul'); // Prevent browsing to link if has child links if(defaults.disableLink == true){ if($(this).siblings('ul').length >0){ e.preventDefault(); } } // Auto close sibling menus if(defaults.autoClose == true){ autoCloseAccordion($parentsLi, $parentsUl); } if ($('> ul',$activeLi).is(':visible')){ $('ul',$activeLi).slideUp(defaults.speed); $('a',$activeLi).removeClass(defaults.classActive); } else { $(this).siblings('ul').slideToggle(defaults.speed); $('> a',$activeLi).addClass(defaults.classActive); } // Write cookie if save state is on if(defaults.saveState == true){ createCookie(defaults.cookie, obj); } }); } // Set up accordion function setUpAccordion(){ $arrow = '<span class="'+defaults.classArrow+'"></span>'; var classParentLi = defaults.classParent+'-li'; $('> ul',obj).show(); $('li',obj).each(function(){ if($('> ul',this).length > 0){ $(this).addClass(classParentLi); $('> a',this).addClass(defaults.classParent).append($arrow); } }); $('> ul',obj).hide(); if(defaults.showCount == true){ $('li.'+classParentLi,obj).each(function(){ if(defaults.disableLink == true){ var getCount = parseInt($('ul a:not(.'+defaults.classParent+')',this).length); } else { var getCount = parseInt($('ul a',this).length); } $('> a',this).append(' <span class="'+defaults.classCount+'">('+getCount+')</span>'); }); } } function linkOver(){ $activeLi = $(this).parent('li'); $parentsLi = $activeLi.parents('li'); $parentsUl = $activeLi.parents('ul'); // Auto close sibling menus if(defaults.autoClose == true){ autoCloseAccordion($parentsLi, $parentsUl); } if ($('> ul',$activeLi).is(':visible')){ $('ul',$activeLi).slideUp(defaults.speed); $('a',$activeLi).removeClass(defaults.classActive); } else { $(this).siblings('ul').slideToggle(defaults.speed); $('> a',$activeLi).addClass(defaults.classActive); } // Write cookie if save state is on if(defaults.saveState == true){ createCookie(defaults.cookie, obj); } } function linkOut(){ } function menuOver(){ } function menuOut(){ if(defaults.menuClose == true){ $('ul',obj).slideUp(defaults.speed); // Reset active links $('a',obj).removeClass(defaults.classActive); createCookie(defaults.cookie, obj); } } // Auto-Close Open Menu Items function autoCloseAccordion($parentsLi, $parentsUl){ $('ul',obj).not($parentsUl).slideUp(defaults.speed); // Reset active links $('a',obj).removeClass(defaults.classActive); $('> a',$parentsLi).addClass(defaults.classActive); } // Reset accordion using active links function resetAccordion(){ $('ul',obj).hide(); $allActiveLi = $('a.'+defaults.classActive,obj); $allActiveLi.siblings('ul').show(); } }); // Retrieve cookie value and set active items function checkCookie(cookieId, obj){ var cookieVal = $.cookie(cookieId); if(cookieVal != null){ // create array from cookie string var activeArray = cookieVal.split(','); $.each(activeArray, function(index,value){ var $cookieLi = $('li:eq('+value+')',obj); $('> a',$cookieLi).addClass(defaults.classActive); var $parentsLi = $cookieLi.parents('li'); $('> a',$parentsLi).addClass(defaults.classActive); }); } } // Write cookie function createCookie(cookieId, obj){ var activeIndex = []; // Create array of active items index value $('li a.'+defaults.classActive,obj).each(function(i){ var $arrayItem = $(this).parent('li'); var itemIndex = $('li',obj).index($arrayItem); activeIndex.push(itemIndex); }); // Store in cookie $.cookie(cookieId, activeIndex, { path: '/' }); } }; })(jQuery); I changed it a little bit so that a click on a main category only opens the submenus but doesn't trigger a site reload. bm_categories.php: function execute() { global $oscTemplate, $cPath; $data = '<div class="panel panel-default no-border hidden-xs hidden-sm">' . ' <div class="panel-heading gradient">' . MODULE_BOXES_CATEGORIES_BOX_TITLE . '</div>' . ' <div class="panel-body ContentBody">' . tep_show_tree_box() . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } No changes! user.css: .nav-list>li /* To prevent selection of text */ { position:relative; padding-left: 5px; -webkit-user-select: none; /* Chrome/Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+ */ /* Rules below not implemented in browsers yet */ -o-user-select: none; user-select: none; cursor:pointer; } .submenu { display:none; } .right-caret:after,.left-caret:after { content:""; border: 5px solid transparent; border-top: 5px solid transparent; display: inline-block; height: 0; vertical-align: middle; width: 0; margin-left:15px; } .right-caret:after { border-left: 5px solid #ffaf46; } .left-caret:after { border-right: 5px solid #ffaf46; } /* EOF CATEGORIES BOX */ No changes! template_top.php after: <script src="ext/jquery/jquery-1.11.0.min.js"></script> add: <script src="ext/jquery/jquery.cookie.js"></script> <script src="ext/jquery/jquery.dcjqaccordion.2.7.min.js"></script> or any other path where you put these js files to......... Case 2: Hover function In that case you need the additional jquery.hoverIntent.js which you also add to template_top.php. In footer.php change the script to: <script type="text/javascript"> $('#accordion').dcAccordion({ eventType : 'hover', // Event for activating menu - options are "click" or "hover" hoverDelay : 50, // Hover delay for hoverIntent plugin menuClose : false, // If set "true" with event "hover" menu will close fully when mouseout autoClose : true, // If set to "true" only one sub-menu open at any time autoExpand : false, // If set to "true" all sub-menus of parent tags with class 'classExpand' will expand on page load speed : 'slow', // Speed of animation saveState : true, // Save menu state using cookies disableLink : false, // Disable all links of parent items showCount : false, // If "true" will add a count of the number of links under each parent menu item cookie : 'dcjq-accordion', // Sets the cookie name for saving menu state - each menu instance on a single page requires a unique cookie name. saveState : true // Save menu state using cookies }); $(".nav-list > li > a.trigger").on("mouseover",function(e){e.preventDefault(); var current=$(this).next(); var grandparent=$(this).parent().parent(); if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))$(this).toggleClass('right-caret left-caret'); grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret'); }); $(".nav-list > li > a:not(.trigger)").on("mouseover",function(){var root=$(this).closest('.nav-list');root.find('.left-caret').toggleClass('right-caret left-caret');});(jQuery); </script> The only thing, which I'm now searching for is a way to reset the jquery cookie in case I click on 'Home' or any other outside the categories nav. In that case the navigation should reset to default. :unsure: I tested it on the latest BS version (osc 2.3.4) - for me it works fine! J.J.
  20. Hi Lambros Sorry for the late reply, but after a week of working until 2-3 clock in the morning I was (I am) very, very tired. I just tested your accordion solution on the fly - without your last addings to template_top, template_bottom and without jquery.hoverIntent.minified.js, modernizr.js, dynamicpage.js (don't know what you added them for). Hey looks good!!!!!! (w00t) And in this state I can find none of the issues you mentioned! - current categories are bold - browser back button works - no interference with grid/list function The only issue I found is that a click on main category opens the accordion but also the category itself. The other thing is that you lost the caret-left caret-right toggle which seems a minor problem. BTW: Why did you add jquery.dcjqaccordion.2.7.min.js? Accordion functionality should be part of the jquery core... Greetz J.J.
  21. Hi Lambros Not so shy - I see no reason why you are not allowed to post some code here!? Others might also be interested in that issue. I think some additional JS is necessary to keep active parents and subs open. Since I've some trouble getting along with JS :blush: a solution from my side may last a while. Maybe someone else have a flash of genius........ J.J.
  22. Hi Lambros, exactly this was my idea too. Currently I use the header solution for the collapsed view, because in that case I want the categories navigation on the top and not somewhere "im Nirvana" - for the full view I have so far the default navigation (which makes me not really happy), but so far I have not found the time to deal intensively with. As I said "quick and dirty".............. :blush: J.J.
  23. That interested me now! :- Just quick and dirty: html_output.php /* Menu cats box*/ function tep_show_tree_box($root_id = 0,$mainUlClass='nav nav-list',$submenuUlClass='nav nav-list submenu'){ global $languages_id,$cPath_array, $datas; $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_status, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' and c.categories_status = '1' order by sort_order, cd.categories_name"); $items = array(); while ($categories = tep_db_fetch_array($categories_query)) { $items[$categories['categories_id']] = array('name' => $categories['categories_name'], 'parent_id' => $categories['parent_id'], 'id' => $categories['categories_id']); } $citems=count($items); if($citems<=0) return ''; elseif($citems==1) $children[] = $items; //in case we have one category item without subcategories, rare but possible else foreach( $items as $item ) $children[$item['parent_id']][] = $item; $loop = !empty( $children[$root_id] ); $parent = $root_id; $parent_stack = array(); $stack=array();//helper array so to know the current level $pic=''; //products_in_category string $datas .='<ul class="'.$mainUlClass.'">'; while ( $loop && ( ( $option = each( $children[$parent] ) ) || ( $parent > $root_id ) ) ){ if ( $option === false ){ $parent = array_pop( $parent_stack ); $datas .= '</ul>'; $datas .= '</li>'; array_pop( $stack ); }elseif ( !empty( $children[$option['value']['id']] ) ){ $stack[]=$option['value']['id']; $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new=count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack); $datas .= '<li><a class="trigger right-caret" href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'">'; $sm=0; if((isset($cPath_array) && in_array($option['value']['id'], $cPath_array))){ $sm=1; $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='</a>'; $datas .= '<ul class="'.$submenuUlClass.'">'; $parent_stack[]=$option['value']['parent_id']; $parent = $option['value']['id']; }else{ $rt=$root_id>0 ? $root_id.'_' : ''; $cpath_new= count($stack)<=0 ? 'cPath='.$rt.$option['value']['id'] : 'cPath='.$rt.implode('_',$stack).'_'.$option['value']['id']; $datas .= '<li><a href="'.tep_href_link(FILENAME_DEFAULT, $cpath_new).'" >'; if (isset($cPath_array) && in_array($option['value']['id'], $cPath_array)) { $datas .='<strong>'.stripslashes($option['value']['name']).'</strong>'; }else{ $datas .=stripslashes($option['value']['name']); } $datas .='</a></li>'; } } $datas .='</ul>'; return $datas; } footer.php: <script type="text/javascript"> $(".nav-list > li > a.trigger").one("click",function(e){e.preventDefault();var current=$(this).next();var grandparent=$(this).parent().parent();if($(this).hasClass('left-caret')||$(this).hasClass('right-caret'))$(this).toggleClass('right-caret left-caret');grandparent.find('.left-caret').not(this).toggleClass('right-caret left-caret');grandparent.find(".submenu:visible").not(current).hide();current.toggle();e.stopPropagation();});$(".nav-list > li > a:not(.trigger)").one("click",function(){var root=$(this).closest('.nav-list');root.find('.left-caret').toggleClass('right-caret left-caret');root.find('.submenu:visible').hide();});(jQuery); </script> user.css: .nav-list>li /* To prevent selection of text */ { position:relative; padding-left: 5px; -webkit-user-select: none; /* Chrome/Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+ */ /* Rules below not implemented in browsers yet */ -o-user-select: none; user-select: none; cursor:pointer; } .submenu { display:none; } .right-caret:after,.left-caret:after { content:""; border: 5px solid transparent; border-top: 5px solid transparent; display: inline-block; height: 0; vertical-align: middle; width: 0; margin-left:15px; } .right-caret:after { border-left: 5px solid #ffaf46; } .left-caret:after { border-right: 5px solid #ffaf46; } and bm_categories.php function execute() { global $oscTemplate, $cPath; $data = '<div class="panel panel-default no-border hidden-xs hidden-sm">' . ' <div class="panel-heading gradient">' . MODULE_BOXES_CATEGORIES_BOX_TITLE . '</div>' . ' <div class="panel-body ContentBody">' . tep_show_tree_box() . '</div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } May need some fine tuning (e.g.hover effects) but in principle it works. (w00t) J.J.
  24. Hi Lambros, I didn't try it but I'm sure it can't be done with the tags I used. I took the dropdown-menu tags which are predefined in the Bootstrap css und show a certain behavior. What you need for the categories box is a structure like this: <div class="panel panel-default"> < div class="panel-heading">Categories</div> <div class="panel-body"> ///bm_categories.php <ul class="nav nav-list"> <li><a href="http://your_path/index.php?cPath=1">Cat_1</a></li> <li><a href="http://your_path/index.php?cPath=2">Cat_2</a></li> <li><a href="http://your_path/index.php?cPath=3">Cat_3</a></li> <li><a href="http://your_path/index.php?cPath=4">Cat_4</a></li> <li><a href="http://your_path/index.php?cPath=5">Cat_5</a></li> ////cats without subs <li><a href="http://your_path/index.php?cPath=5"><strong>Cat_6</strong></a> //cat with subs <ul class="nav nav-list"> <li><a href="http://your_path/index.php?cPath=5_1"> Subcat_1</a></li> <li><a href="http://your_path/index.php?cPath=5_2"> Subcat_1</a></li> <li><a href="http://your_path/index.php?cPath=5_3"> Subcat_1</a></li> </ul> ///end subcats </li> ///end Cat_6 <li><a href="http://your_path/index.php?cPath=7">Cat_6</a></li> .................. </ul> </div> ///bm_categories.php </div> Should be possible to integrate this with gadlols great code. :rolleyes: I'm really looking forward to your results. Gruß J.J.
×