Jump to content
Latest News: (loading..)

GLWalker

♥Ambassador
  • Content count

    842
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by GLWalker

  1. 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> ' . $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.
  2. This is the support thread for the Customer Service Portal https://apps.oscommerce.com/xihXD&customer-service-portal The primary goal of the Customer Support Portal is to allow osCommerce shop owners to allow their employees to work on order fulfillment and customer support inquiries without having to allow direct admin access. Additionally it serves as a full fledged order placement system that will work with a shops existing payment methods, as well as a couple of new payment modules that could be useful in case alternate means of payment processing are desired, or in person cash sales are needed. The Customer Support Portal also allows a true guest checkout option. No customer is created if this option is used. All customer information is stored only in the actual order information. There is a quick link in the Customer Portal Header menu that allows guest orders to be viewed separately from the rest of the store orders. Please note that in the ht_customer_service module settings there is an email field to fill out, by default it uses the store owners set email address. This email is used for certain functions within the Customer Service Portal, such as a placeholder email in guest account creation. It will always be populated on the guest customers information field, just to skip the additional step of gathering an email address from a guest. Whenever done with guest accounts, or even logging into an existing customers account always go back to the dashboard. This resets the session for that particular customer. If you are in a customers account, then you have to take on a session allowing you to access their info, the dashboard kills any sessions that are not related directly to you the customer service agent. If you are using the cash payment option, you will need to adjust the sort order of you order total module sp that the order totals and cash back amounts are computed correctly. Helpful Videos: https://www.youtube.com/watch?v=cwaid91cp1A&feature=youtu.be https://www.youtube.com/watch?v=dLgiD1FoTj4&feature=youtu.be Known issues: This plugin has been used in working shops for a number of years and proven to be stable. There are howver 2 issues I am aware of. 1) If a product in the cart has attributes, the update quantity field wont work properly. If a different quantity is desired, just delete it and add the correct quantity from the product listing itself. 2) I have not noticed this until testing on PHP 7.0, when using the cash payment option, the update button needs to be clicked twice. Feel free to post with comments or suggestions.
  3. GLWalker

    [Contribution] Customer Support Portal

    Hi everyone, thanks for the input thus far, I probably rushed into getting it ready for the BS Community edition, and overlooked a few things. If anyone is using the standard 2.3.XX download, use the first version I uploaded, should be fine. I'll make more changes and upload, I've been n the middle of a move, so this was my first chance back online since the last time I posted. As for the GitHub recommendation, I have been thinking of that too, so expect to see a repo soon. Existing order editing - this doesn't do that - but if there's enough interest it could.
  4. A few here have seen it before, it's just been sitting on my desk doing much of nothing, so I am currently packaging it up. The first one to install it owes me a beer steak dinner.
  5. GLWalker

    [Contribution] Customer Support Portal

    New update addressing errors here uploaded. Another update will come addressing specials price. The price does show as special while in the cart, just not in the product listing.
  6. GLWalker

    [Contribution] Customer Support Portal

    Just searched around on this file and it appears that it was only being used with USPS module, and it's outdated as well, so it was removed from the BS version.
  7. GLWalker

    [Contribution] Customer Support Portal

    Code has been updated for compatibility with Bootstrap Community version. Please report any further bugs.
  8. GLWalker

    [Contribution] Customer Support Portal

    Ahhh, yes.. forgot about those changes for the BS edition - my most recent testing was on the standard 2.3.4.1 download. I'll make changes and update. Thanks for the feedback.
  9. GLWalker

    Ive got a suprise coming

    Submitted, in the que awaiting approval
  10. GLWalker

    Ive got a suprise coming

    And here's some general usage: https://youtu.be/dLgiD1FoTj4
  11. GLWalker

    Ive got a suprise coming

    How about this for install instructions https://youtu.be/cwaid91cp1A
  12. GLWalker

    Ive got a suprise coming

    wrapping up a few changes after testing on php7.0.
  13. GLWalker

    Admin responsive sidebar with bootstrap

    Thats pretty sharp looking. Good job.
  14. GLWalker

    Ive got a suprise coming

    Yup, you could say that install instructions are the wrapping, except that I like wrapping gifts, not so much writing install instructions. Fortunately, the module pretty much tells you what to do so instructions will be very dry... upload, install, that's all folks...
  15. Need coffee...

    1. Show previous comments  1 more
    2. Tsimi

      Tsimi

      Nice to hear from you again Gary. :smile::thumbsup:

    3. GLWalker

      GLWalker

      Thanks All :thumbsup:Wheres the beer emoti?

    4. Dan Cole

      Dan Cole

      We thought you took it...it disappeared around the time you left.  :biggrin:

  16. Soviet interference by Soviet premier Putin! LOL! What a croc.

    1. MrPhil

      MrPhil

      Da, comrade. And just today, FBI director Comey was sacked for letting his investigation get too close to our Dear Leader.

  17. @@ArtcoInc Is it the text or onHover color that changes incorrectly, either way, have you just simply marked that particular element in the style as !important? Looks like maybe .dropdown-menu > .dropdown > a:after, .dropdown-submenu > a:after may need something like color: #cccccc !important More than likely an existing rule in the Bootstrap CSS is overriding it, its probably a matter of targeting that specific selector, even if it means applying the rules all the way into a nested level. May need to list all levels in the css to get it, like: .navbar-nav > li > .dropdown-menu > li > a:hover { your rules here } Or maybe just simpler with the Important rule: .dropdown-submenu > a:hover { your rules here !important; }
  18. I love how this has come along. Amazing what can happen by leaving code snippets laying around a forum. :thumbsup:
  19. hmmm, we may need a new thread for all the 2.4 talk. Weve kind of hijacked the BS community thread. Too much BS I guess.
  20. @@kymation :thumbsup: Yes that is, Ive played with it and got so far, but I think its more powerful than just what that example shows - reading through the latest classes I see where it has actions and execution. I would to see how it would handle a page, like contact us for example, I want to see how it would route the output after the submit form action is initiated. Kind of like was started here: https://github.com/haraldpdl/oscommerce2/tree/24-checkout/includes/apps/info
  21. @@ShaGGy 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.
  22. GLWalker

    2.4 Series

    @@MrPhil https://github.com/haraldpdl/oscommerce2/tree/admin_bootstrap Much of the community version was imported for use.
  23. GLWalker

    2.4 Series

    @@Harald Ponce de Leon Is it possible we can get an example page using the hooks/apps? Preferably something like the contact_us. I would like to see how the actions would be constructed in this method. I see code for an execute action but can quite figure out how to trigger it.
×