Jump to content



GLWalker

Member Since 14 Mar 2005
OFFLINE Last Active Apr 12 2017 04:36
****-

#1747994 Horizontal Categories Menu BS

Posted by GLWalker on 30 September 2016 - 02:47

I love how this has come along. Amazing what can happen by leaving code snippets laying around a forum. :thumbsup:




#1746729 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 18 August 2016 - 16:12

@ShaGGy

 

In addition, we'll have a compatibility module available for those upgrading that will wrap removed functions (eg database) and constants (eg filenames, database names) to the new framework changes. This should allow v2.3 modules to continue to work with v2.4.

 

 

As mentioned, there will be compatibility. IMO - HPDL has been too generous in insuring addons have stayed compatible from version to version.

 

Without a compatibility layer the minimal changes I foresee needing to be done to make an old addon work:

 

MySQL queries  - They need to be changed to take advantage of the PDO driver. End result - faster & more secure.

HTML functions - rather than tep_draw_*  it would change to HTML:: or OSCOM:: - End result - can easily be overwritten, extended, or replaced by including your own class.

Defines  - No more more FILENAME_WHATEVER or TABLE_BLAH_BLAH_BLAH - End result, less processing by the program.

 

Other than those things, the older addons can still follow the same installation procedures as before. However, with the newer framework, we wont have to hack the core and as a result we will probably start seeing better addons. I think that alone will attract more users, both shop owners and dev's.

 

Ive worked on tons of osC sites through the years, I was inspired to become a web dev thanks to osC and a couple members on this forum, but I tell you - I'm also tired of hacking at core to do things. I try not too - I extend and bend where I can -  The new code base - beautiful - write a class, upload it, watch things change. BAM!

 

If an end user doesn't want to use the program because it changed, they can and will find another software. But if the software doesn't change, they still can and will find another software.

 

Really, osCommerce has been great through the years, your not going to find an ecommerce software with such a broad range of server compatibility and customization ready base. Look how many forks have branched off of osC. But now what are those forks doing? Nothing really, they have reached EOL - all the 500 addons they pulled straight from the contribution section has caught up with them. Now they are all outdated and osC is the only one that has advanced its code base so as not to get outdated, yet it also seems like osC is the one that has took the most crap. Can't win for loose they say.

 

Anyway, as all can see, there is going to be compatibility, there is all the effort of the community build rolled in, and there is new modern code. Compare the new code to other open source software out there - Ive been reading it for 2 weeks straight. Its well ahead of anything right now. PHP7 - no problem, 2 years from now - PHP10  - probably good to go there as well.




#1746693 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 18 August 2016 - 05:13

You mean certified to submit addons? if so i think that might be a bad idea as why write modules for OSC if you have to become certified you may as well write for one of the others and be paid for the addon.

 

I think there are a lot of opinions on what certified developers could mean. When I think about it, I don't feel as if it should be a requirement for submitting an addon, Anyone should still be able to write and submit an addon.

 

I think of it more in terms that if you are certified, then that is something you can use to show the public that you know what you are doing with osCommerce code and they can have confidence in dealing with you on a commercial basis.

 

A lot of things could define that certification, and if you/your dev company starts to do sloppy work, there could be a revocation of your certification.

 

It would also help to have that little badge in the addons as well. Rather than have to click on @Jack_mcs username and see a list of his downloads after I first find one of his downloads so I can click the name, I can just "sort by certified" and there are all his addons in the list.




#1746629 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 16 August 2016 - 19:10

I, for one, am certainly happy to see the changes happening in OSC core.

 

No more filename defines is freaking great. No longer have to write FILENAME_BLAH_BLAH_BLAH to keep in the projects standards when writing code. But besides that, the main benefit being less define(s) and interpretations. A small but beneficial micro-optimization.

 

So someone found a bug, albeit a small bug that apparently reared its head on a 1.99 per month bucket host, still a bug. I see that bug was reported as an issue with link to how to correct. That's great. And it looks as though an answer was given that said the area it involves was going to change soon. What more is there to worry about?

 

And that's all small stuff:

 

How about that new code? Anyone been following HPDL's Git? IMO it's a little much, I would scale back some of the changes and rethink it a bit, However - its freaking good stuff going on. 100% F*#@ing great. All the new code is modern and following what standards we do have for PHP.  I guarantee its faster, better efficient, and has a long term future.

 

So speaking of code and future, as a result of the new code base changes, every addon currently available will not work without being rewritten. But so what? I rewrite over 80% of things I find in the addons section anyway. osC has kept the core the same for far too long, and much of the reason has probably been to satisfy those who rely on the addons, or those who do not want to see a more modular way of installing addons. (You cant charge as much to push a $button).

 

Its well past time to change core. Everyone knows it. There's those that welcome the change, then there's those that will bitch and cry-baby about it. In creating the responsive community edition, we've pretty much seen that. If the main core would have changed - what - 5 or 6 years ago, people would have bitched about their addons not working then, and devs would have cried about loosing business, but you know what? That would have been then, and now would look a lot different. Inevitably things are going to look different. 

 

Good luck to osC, its great, and it always will be. One way or another.




#1745169 Responsive Themes for Bootstrapped Community Version (BS)

Posted by GLWalker on 24 June 2016 - 17:48

ANY good theme, unfortunately even poor themes, cost what they do for good reason. The work involved in putting a theme together takes many hours, a lot of detail work, and then to make a theme that does not touch any core files with osCommerce, is even a more daunting task. But the end result is a well crafted theme that will not interfere with any future updates and shall prove to perform reliably for the long run.

 

I mean, I and others here, can quickly retheme a site in a short time, but then there are all the elements that need to be fine tuned, blended, made to compliment each other, and work well across multiple Operating Systems and devices. A theme for $99 dollars is a bargain, there is the intent that it will sell well enough to cover the cost of the time and effort involved. Ask a coder to do the same for an individual site and the cost can start at ten fold more and rise from there.




#1712412 Amend the Template Structure

Posted by GLWalker on 07 January 2015 - 16:38

No harm leaving the header and footer files, the code placed in template_top and bottom would just be moved into those files, much like it was before but with the addition changes for wrapping the area.

 

My main thought on doing away with those files was the .00000001% gain by not having to include 2 more files, and looking at the previous column left and right that were removed in favor of the code directly in the template_bottom file.

 

 

I will change the struture on my fork and resubmit.

 

I would however like to know thoughts on using HTML5 section, header, and aside elements. We do already use nav and footer elements, so it seems that adding in the other markup makes sense to those, both human and bot,  that follow HTML5 standards.




#1712355 Amend the Template Structure

Posted by GLWalker on 06 January 2015 - 16:56

@burt

 

Per my previous post, I would like to make a proposal for slight change to the template structure/markup for better theme control and overall layout.

 

Ive been looking at a lot of the bootstrip examples and do feel we would be more on target by changing the structure to follow as outlined below:

<!DOCTYPE html>
<html>
  <head></head>
  <body>
    <nav>navigation_content</nav>
      
    <div class="row">
      <div class="col-sm-12">messageStack_header</div>
    </div>
      
    <header id="modular-header" class="BOOTSTRAP_CONTAINER">
      <div id="header" class="row">
        header_content
      </div>
    </header>
     
    <section id="bodyWrapper" class="BOOTSTRAP_CONTAINER">
        
      <div class="row">
        <div id="bodyContent" class="col-md-* col-md-push-*">
          
          <div class="row">
            <div class="col-xs-12">
              <div class="alert alert-danger">error_message</div>
            </div>
          </div>
            
          <div class="row">
            <div class="col-xs-12">
              <div class="alert alert-info">info_message</div>
            </div>
          </div>
            
          <div class="contentContainer">main_content_per_page</div>
            
        </div> <!-- bodyContent //-->
          
        <aside id="columnLeft" class="col-md-*  col-md-pull-*">
          boxes_column_left
        </aside>
          
        <aside id="columnRight" class="col-md-*">
          boxes_column_right
        </aside>
          
      </div><!-- row -->
    </section> <!--bodyWrapper-->
      
    <footer id="modular-footer" class="BOOTSTRAP_CONTAINER">
      <div id="footer" class="row">
        footer_content
      </div>
      <div id="footer-extra" class="row">
        footer_suffix_content
      </div>
    </footer>
      
  </body>
</html>

Pay no emphasis to the HTML5 elements, they are only there for empahasis!

 

Basically every section would have its own container wrapped around it, yet eveything is still stackable and in order.

 

row classes have been inserted where need be before any dections that would use a col-sm-* class

 

error and info messages have been moved down after the bodyContent opening div to place them better into the view of everything and avoid breaking design by having them float under the header.

 

id's applied to each section mainly for design purposes, and allows to set the bootstrap contianer for each section - wait thats design!

 

I only wonder if placing the footer and footer-extra into one container should be broke into 2 parts, so that the footer-extra has the ability to act like the top nav with nothing wrapping it but itself.

 

 

I really wouldnt even include the header and footer anymore either, just the code to grab the content.

 

So thats my proposal of the day, have tested it on my local and everything lays out as were used to seeing.




#1712350 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 06 January 2015 - 16:39

Ok - I found the closing tag in footer shortly after I posted - :~

 

Actually, with the inclusion of dynamic header and footer content, we do not even need to include the header and footer at all anymore. I dont know if that would be confusing to anyone used to the header and footer, but from here on when I build a new site with this build, I will make the complete header inside a header_content_module template file.

 

For those that may be intimadatted by coding module content, it really does not have to be complicated, a very simple cm_header_module.php file needs nothing more than the standard markup and a call to include the template file, then the template file can be coded just like the standard headers we are accustomed to. For an example, look at includes/modules/checkout_success/cm_cs_downloads.php <-- thats about as simple a method your going to find, no need to include a bunch of global variables.

 

You could create all the differnt headers you like and switch them out on the fly, or even per category or page load. This software just keeps getting more and more dynamic with minimal changes!




#1712171 Select pages to display Responsive Breadcrumb

Posted by GLWalker on 03 January 2015 - 18:59

@PupStar

@auzStar

 

Very good example here, but we can do it a bit easier, IF - only if - as I am going off of the original question in the other thread - we want to only hide the breadcrumb on the homepage, but show on the rest of the index for categories and manufactures - as @burt suggested, edit the template file:

 

open/catalog/includes/modules/content/header/templates/breadcrumb.php

replace with this:

<?php
  if ( (!strpos($_SERVER['PHP_SELF'], 'index.php')) || (strpos($_SERVER['PHP_SELF'], 'index.php') && isset($_GET['manufacturers_id']) || isset($_GET['cPath']) ) )  { ?>					
  <div class="col-sm-<?php echo $content_width; ?>">
    <?php echo $breadcrumb->trail(' &raquo; '); ?>
  </div>			
<?php
  }
?>

Basically, we check if were on index do not load, but if we are on index and a category or manufacturer is set, then do load. Any other pages that the breadcrumb should be excluded on can also be added in.

 

No edits to the core breadcrumb module, however, there is also a variable, $current_category_id, which could be used in place of $_GET['cPath'], but had we used that then it would have had to be added to the globals inside the actual cm_header_breadcrumb module.




#1710458 Purchase Without an Account?

Posted by GLWalker on 05 December 2014 - 20:51

@burt

Ah yes, I remeber seeing your screenshot or video for that a few months ago :thumbsup:

 

@wHiTeHaT

 

I have confimed a random generated customer_id will work with multiple "guest checkouts if we set the id VIA session key to  bypass any create account functions we can go to the address_book, dynamically add a session based email and phone number, then collect the standard address info - BAM! order complete, all info recorded, email updates can be sent out.

 

So this bypasses any script that would want to update customer, customer_info tables, and prevents an anwanted welcome email, yet still allows for an order success email.

 

I did 2 orders at the same time simutaniously running open windows of the same browser - no conflicts, 1 a COD order, the other using Stripes test CC numbbers which had to create a connection to process

 

I set the random IDs to begin with 00, this way I think I can set up a search function to lookup only the guest orders using a match first two as 00 - as a real customer will never have an id that starts with 00.

 

But thats not on a default install, but Im sure a little tweaking can get it there.

 

Maybe next year it will see the light of day. If done correctly, it should port over to the next version with little adjustment :-




#1710395 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 05 December 2014 - 14:46

@burt

 

I'll be testing out new changes soon, then provide feedback. 

 

I do agree the product listings need a tune up and strip down, it was nice at the time, but looking back, just too much extra that can already be achieved using bootstrap default classes.

 

I have some markup that can help with a shopowners preferance on default view as well, but will first test with new setup.




#1708479 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 14 November 2014 - 23:30

@acidvertigo  Somewhat - I haven't given up on it, but life called and said I need to go to work. I hope to move on with the file changes in the next couple of weeks. I think it is close to the point where many of the files will have similar enough changes to run with it.




#1708395 Bootstrap 3 in 2.3.4 - Responsive from the Get Go

Posted by GLWalker on 13 November 2014 - 22:07

Amazing, 55 pages in this thread, and most all of it is about BS.




#1708066 234BS New Products Module

Posted by GLWalker on 09 November 2014 - 02:05

As noted, you have to change the col-xx-xx class, but you will not be able to get five in 1 row. The bootstrap class just doesn't equal out to 5. Every thing divides into 12.

 

So currently you have three as the class is col-md-4  ~ 4/8/12 = 3

 

You can do 4 across by using col-md-3

 

or jump to 6 across by using col-md-2

 

You may also need to adjust the settings in admin/configuration/maximum values/new products module




#1707112 osCommerce 2.3. Bootstrap Nav menu

Posted by GLWalker on 20 October 2014 - 20:15

The following code snippets will extend the categories class as found in the osCommerce to Bootstrap community build. Please note it only works on this version as no other version is using this category class (in production).

 

Its up to you where you place this class, you can make a file and add it with the other classes, just add it to template_top.php for quick setup, or go all out and take all the code and make a module.

 

So first lets extend the category class with need markup for a bootstrap nav menu.

  /*
  $Id$ explode_category_tree

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2010 osCommerce
  
  extended class author: G.L. Walker
  Copyright (c) 2014 G.L. Walker

  Released under the GNU General Public License
*/
  class explode_category_tree extends category_tree {
    
    var $parent_group_start_string = null,
	    $parent_group_end_string = null,
		$parent_group_apply_to_root = false,
		$root_start_string = '<li class="dropdown">',
		$root_end_string = '</li>',
		$parent_start_string = '<ul class="dropdown-menu">',
		$parent_end_string = '</ul>',
		$child_start_string = '<li>',
		$child_end_string = '</li>';
    
    function _buildHoz($parent_id, $level = 0) {
      if(isset($this->_data[$parent_id])) {
        foreach($this->_data[$parent_id] as $category_id => $category) {
          if($this->breadcrumb_usage === true) {
            $category_link = $this->buildBreadcrumb($category_id);
          } else {
            $category_link = $category_id;
          }
          if(($this->follow_cpath === true) && in_array($category_id, $this->cpath_array)) {
            $link_title = $this->cpath_start_string . $category['name'] . $this->cpath_end_string;
          } else {
            $link_title = $category['name'];
          }

		  if (isset($this->_data[$category_id]) && ($level != 0)) {
            $result .= '<li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret = false;
          } elseif(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            $result .= $this->root_start_string;
            $result .= '<a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">';
            $caret =   '<span class="caret"></span>';
			
          } else {
            $result .= $this->child_start_string;
            $result .= '<a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
            $caret = false;
          }
		  
          $result .= str_repeat($this->spacer_string, $this->spacer_multiplier * $level);
          $result .= $link_title . (($caret != false) ? $caret : null) . '</a>';
		  
          if(isset($this->_data[$category_id]) && (($this->max_level == '0') || ($this->max_level > $level + 1))) {
            // uncomment below to show parent category link //
		    //$root_link_title =  '<span class="hidden-xs"><span class="glyphicon glyphicon-th-list"></span>&nbsp;' . $link_title . '</span><li class="divider"></li>';
			// divider added for clarity - comment out if you no like //
			//$root_link_title .= '<li class="visible-xs divider"></li>';
			
            $result .= $this->parent_start_string;
            $result .= '<li><a href="' . tep_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">' . $root_link_title . '</a></li>';
            $result .= $this->_buildHoz($category_id, $level + 1);
            $result .= $this->parent_end_string;
            $result .= $this->child_end_string;
          } else {
            $result .= $this->root_end_string;
          }
        }
      }
      return $result;
    }
    function getExTree() {
      return $this->_buildHoz($this->root_category_id);
    }
  }
/* end explode_category_tree */

Now you need to add a function somewhere, either in html_output.php or just slap it in template_top if doing a quick setup:

  function build_hoz($class='') {
    global $cPath, $level;
	
    if (empty($class)) $class = 'nav navbar-nav';

    $OSCOM_CategoryTree = new explode_category_tree();
    $data = '<ul class="' . $class . '">' . $OSCOM_CategoryTree->getExTree() . '</ul>';

    return $data;
  }

Notice the class variable, you may or may not need to use it according to the later steps.

 

Now here is the css markup to add to your stylesheet:

.dropdown-submenu { position:relative;}
.dropdown-menu > .dropdown > .dropdown-menu, .dropdown-submenu > .dropdown-menu{top:0;left:100%;margin-top:-6px;;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px;}
.dropdown-menu > .dropdown > a:after, .dropdown-submenu > a:after{display:block;content:" ";float:right;width:0;height:0;border-color:transparent;border-style:solid;border-width:5px 0 5px 5px;border-left-color:#cccccc;margin-top:5px;margin-right:-10px;}
.dropdown-submenu:hover > a:after{border-left-color:#555;}

And you may or may not need the javascript, it depends on a couple of things, I'll let you figure it out, but start by adding it to template_bottom.php


<script>
$(document).ready(function(){
    $('ul.dropdown-menu > li.dropdown > a.dropdown-toggle .caret').removeClass('caret');
    $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
      event.preventDefault();
      event.stopPropagation(); 
      $(this).parent().siblings().removeClass('open');
      $(this).parent().toggleClass('open');
    });
});
</script>

If you do not have any subcategories, and you are using a  nav menu the top categories displaying across the menu, you wont need any of the javascript. If you want to nest the category menu inside a single dropdown link, you will only need the first line after document ready(or you can actually modify the extended class)  I simply gave a way of doing things that would fit a variety of applications. If I am confusing you, just add everything.

 

 

Now inside your markup for a bootstrap nav menu their are 2 ways you can output the category tree

 


    <nav class="navbar navbar-default navbar-no-corners navbar-no-margin" role="navigation">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse">
          <span class="sr-only"><?php echo HEADER_TOGGLE_NAV; ?></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
      </div>
      
      <div class="collapse navbar-collapse" id="bs-navbar-collapse">
        <div class="container-fluid">
          <ul class="nav navbar-nav">
            <li class="dropdown">
              <a class="dropdown-toggle" data-toggle="dropdown" href="#">Categories<span class="caret"></span></a>
              <?php echo build_hoz('dropdown-menu');?>
            </li>
          </ul>
          <?php echo build_hoz(); ?>
        </div>
      </div>
    </nav>

I combined the 2 together in the above code. You can pretty much make it part of the navbar top links, or next it inside one top link.

 

Ive tested this up to eight sub-categories deep with great results - but if you go that crazy on a live shop, you probably need a consultant to help you better categorize- maybe an auto parts store may need that many.