

PupStar
-
Content count
896 -
Joined
-
Last visited
-
Days Won
10
Reputation Activity
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
Nothing to do with the latest code changes - cut and paste from product_reviews.php?products_id=x
However, your incorrect testing has thrown up an anomaly which I am working on. Cheers!
-
PupStar got a reaction from oscMarket in Responsive osCommerce - Bootstrap
@@burt
I have made the changes and this is the outcome
-
PupStar got a reaction from oscMarket in Responsive osCommerce - Bootstrap
@@burt
I have made the changes and this is the outcome
-
PupStar reacted to auzStar in Select pages to display Responsive Breadcrumb
@@GLWalker
Yes you're right, probably a bit of overkill for the selectable pages but it was just another option since @@PupStar mentioned he would like such a thing, to quote "Saying that, it would be nice to have the option to pick and choose which page I show it on" in this post http://forums.oscommerce.com/topic/396152-bootstrap-3-in-2334-responsive-from-the-get-go/?p=1712125
No problem.
cheers :)
-
PupStar reacted to auzStar in Select pages to display Responsive Breadcrumb
@@PupStar
Wow! How did that line of code got in their. It was just a straight copy and paste from my working code into my post. It's added a member called "dir". Does such a member exists? :lol:
if ($dir = @[member='dir'](DIR_FS_CATALOG)) { Below is what line 101 is supposed to be (I did a file compare with code above, this is the only difference):
See if it happens again. It's obviously the "@" causing the change.
if ($dir = @[member=dir](DIR_FS_CATALOG)) { I stayed right when I posted, but changed when I edited the post (to write this). Which is what must have happened above.
Changed back to correct code.
Sorry about that. :D
cheers
-
PupStar reacted to GLWalker in Select pages to display Responsive Breadcrumb
@@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(' » '); ?> </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.
-
PupStar got a reaction from auzStar in Responsive Stylish Breadcrumb Trail
Cheers Dominic, that should be that as it works well now.
One thing I had to do was to change the css to accomodate long product names
People may need to play with this depending on their product names length
/* === For tablets ================================== */ @[member=media] (min-width: 768px) and (max-width:991px) { .btn-breadcrumb > *:nth-last-child(-n+4) { display:block; } .btn-breadcrumb > * div { max-width: 100px; } } /* === For desktops ================================== */ @[member=media] (min-width: 992px) { .btn-breadcrumb > *:nth-last-child(-n+6) { display:block; } .btn-breadcrumb > * div { max-width: 270px; } } Happy new year to you as well :thumbsup:
Mark
-
PupStar reacted to auzStar in Responsive Stylish Breadcrumb Trail
@@PupStar
In catalog/includes/classes/breadcrumb.php it's missing the ellipse that the js code is looking for ie ellipses2 = $("#bc2 :nth-child(2)")
If you look at the html of the snippet you'll see there is "<div class="btn btn-default">...</div>" after the "home" link.
I've inserted in the code below. Needed to hide it initially.
for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if ($i == 1) $trail_string .= '<div class="btn btn-default" style="display: none;">...</div>'; if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<a itemscope itemtype="http://data-vocabulary.org/Breadcrumb" class="btn btn-default" href="' . $this->_trail[$i]['link'] . '" itemprop="url"><div itemprop="title">' . $this->_trail[$i]['title'] . '</div></a>'; cheers
All the best for the new year :)
-
PupStar reacted to burt in Template "New Products For Month" ...
Here is the first draft of the template structure for the "New Products For Month" module in the front page of most osCommerce sites;
1. change /includes/modules/new_products.php to:
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } $num_new_products = tep_db_num_rows($new_products_query); if ($num_new_products > 0) { echo '<h3>' . sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')) . '</h3>'; echo '<div class="row">'; while ($new_products = tep_db_fetch_array($new_products_query)) { include(DIR_WS_MODULES . 'templates/new_products.php'); } echo '</div>'; } 2. Make a new folder called "templates" inside of the existing modules folder. /includes/modules/templates/
3. Inside that new folder, make a new file called new_products.php
4. In that new file, paste the following:
<div class="col-sm-6 col-md-4"> <div class="thumbnail equal-height"> <?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . (int)$new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; ?> <div class="caption"> <p class="text-center"><?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . (int)$new_products['products_id']) . '">' . $new_products['products_name'] . '</a>'; ?></p> <hr> <p class="text-center"><?php echo $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); ?></p> <div class="text-center"> <div class="btn-group"> <?php echo '<a href="' . tep_href_link('product_info.php', tep_get_all_get_params(array('action')) . 'products_id=' . (int)$new_products['products_id']) . '" class="btn btn-default" role="button">' . SMALL_IMAGE_BUTTON_VIEW . '</a>'; ?> <?php echo '<a href="' . tep_href_link('index.php', tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . (int)$new_products['products_id']) . '" class="btn btn-success" role="button">' . SMALL_IMAGE_BUTTON_BUY . '</a>'; ?> </div> </div> </div> </div> </div> So far so good. Refresh the index page of your site a few times. Any changes? Should be zero change.
5. Open up that new template file, and change it to:
<div class="col-sm-3"> <h1><?php echo '<a href="' . tep_href_link('product_info.php', 'products_id=' . (int)$new_products['products_id']) . '">' . $new_products['products_name'] . '</a>'; ?></h1> <h2><?php echo $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])); ?></h2> </div> Once again, refresh the index page. Any changes?
In this way, shopowners and developers can amend the look of the module without having to touch core code. Any thoughts and feedback would be appreciated.
-
PupStar reacted to tgely in Template "New Products For Month" ...
Happy New Year @@burt and all
yes this is the best way. One note for template structure would be better in a separated folders.
example:
catalog/templates/basic/modules/new_products.php
catalog/templates/basic/index.php
-
PupStar reacted to De Dokta in Template "New Products For Month" ...
@@burt
Tested it in an unmodified and a heavily modified BS shop. Works fine in both full and collapsed view.
I agree with altoid that the New Products module should be removable from the admin. In the german forum I answered a million times the question of users how to remove it from the start page...
J.J.
-
PupStar got a reaction from burt in Responsive Stylish Breadcrumb Trail
@@burt
I presume this is the result we a looking for
-
PupStar got a reaction from grandpaj in Responsive Stylish Breadcrumb Trail
I have managed to modify/pretify the breadcrumb trail to look like well nicer (screenshot at bottom of post)
I take no credit for the actual code used as I only integrated it into oscommerce from http://bootsnipp.com/snippets/featured/responsive-breadcrumbs (mods please remove if link is not allowed)
Tested in Firefox, Chrome and IE11 ok
This is how I did it
1. replace catalog/includes/classes/breadcrumb.php with
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class breadcrumb { var $_trail; function breadcrumb() { $this->reset(); } function reset() { $this->_trail = array(); } function add($title, $link = '') { $this->_trail[] = array('title' => $title, 'link' => $link); } function trail($separator = NULL) { $trail_string = '<div class="row">'; $trail_string = '<div id="bc2" class="btn-group btn-breadcrumb">'; for ($i=0, $n=sizeof($this->_trail); $i<$n; $i++) { if (isset($this->_trail[$i]['link']) && tep_not_null($this->_trail[$i]['link'])) { $trail_string .= '<a class="btn btn-default" href="' . $this->_trail[$i]['link'] . '">' . $this->_trail[$i]['title'] . '</a>' . "\n"; } else { $trail_string .= '<li>' . $this->_trail[$i]['title'] . '</li>'; } } $trail_string .= '</div>'; return $trail_string; } } ?> 2. replace catalog/includes/modules/content/header/templates/breadcrumb.php
<div class="col-sm-<?php echo $content_width; ?>"> <div class="nav navbar-nav breadcrumb-margin"> <?php echo $breadcrumb->trail(' » '); ?> </div> </div> 3. replace catalog/includes/modules/content/header/cm_header_breadcrumb.php
The main change in this file was to add the selectable column width.
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2014 osCommerce Released under the GNU General Public License */ class cm_header_breadcrumb { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function cm_header_breadcrumb() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_HEADER_BREADCRUMB_TITLE; $this->description = MODULE_CONTENT_HEADER_BREADCRUMB_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS') ) { $this->sort_order = MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER; $this->enabled = (MODULE_CONTENT_HEADER_BREADCRUMB_STATUS == 'True'); } } function execute() { global $oscTemplate, $breadcrumb; $content_width = (int)MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH; ob_start(); include(DIR_WS_MODULES . 'content/' . $this->group . '/templates/breadcrumb.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS'); } function install() { tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Header Breadcrumb Module', 'MODULE_CONTENT_HEADER_BREADCRUMB_STATUS', 'True', 'Do you want to enable the Breadcrumb content module?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '1', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())"); tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_HEADER_BREADCRUMB_STATUS', 'MODULE_CONTENT_HEADER_BREADCRUMB_CONTENT_WIDTH', 'MODULE_CONTENT_HEADER_BREADCRUMB_SORT_ORDER'); } } 4. add the following to your user.css
.breadcrumb-margin { margin: 20px 0; } .btn-breadcrumb .btn:not(:last-child):after { content: " "; display: block; width: 0; height: 0; border-top: 17px solid transparent; border-bottom: 17px solid transparent; border-left: 10px solid white; position: absolute; top: 50%; margin-top: -17px; left: 100%; z-index: 3; } .btn-breadcrumb .btn:not(:last-child):before { content: " "; display: block; width: 0; height: 0; border-top: 17px solid transparent; border-bottom: 17px solid transparent; border-left: 10px solid rgb(173, 173, 173); position: absolute; top: 50%; margin-top: -17px; margin-left: 1px; left: 100%; z-index: 3; } /** The Spacing **/ .btn-breadcrumb .btn { padding:6px 12px 6px 24px; } .btn-breadcrumb .btn:first-child { padding:6px 6px 6px 10px; } .btn-breadcrumb .btn:last-child { padding:6px 18px 6px 24px; background-color: #f4f4f4; } /** Default button **/ .btn-breadcrumb .btn.btn-default:not(:last-child):after { border-left: 10px solid #fff; } .btn-breadcrumb .btn.btn-default:not(:last-child):before { border-left: 10px solid #ccc; } .btn-breadcrumb .btn.btn-default:hover:not(:last-child):after { border-left: 10px solid #ebebeb; } .btn-breadcrumb .btn.btn-default:hover:not(:last-child):before { border-left: 10px solid #adadad; } 5. Add this to the bottom of the catalog/includes/template_bottom.php
<script> $(document).ready(function(){ $(window).resize(function() { ellipses1 = $("#bc1 :nth-child(2)") if ($("#bc1 a:hidden").length >0) {ellipses1.show()} else {ellipses1.hide()} ellipses2 = $("#bc2 :nth-child(2)") if ($("#bc2 a:hidden").length >0) {ellipses2.show()} else {ellipses2.hide()} }) }); </script> That should be it I think.
One issue I can not seem to resolve is how to get the breadcrumb to be responsive like in the demo, so if any one can spot whats missing please speak up :thumbsup:
Mark
-
PupStar reacted to altoid in Responsive osCommerce - Bootstrap
I have the micro data installed. If you want to see how the page source shows or anything such just let me know.
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
@@PupStar - the new system looks daunting, not? In fact, I believe it's quite straightforward once you get into the nuts and bolts of it. What you've done is amended the "template" file without changing the "control" file. That has to be a good thing, as the template file would never be changed on an osc update...hence your template file would never change (making life easier when updating, as your site maintains its look)...makes sense ?
-
PupStar reacted to greasemonkey in Responsive osCommerce - Bootstrap
@@PupStar please ignore my ramblings... I see Gary moved logo (and a bunch of others too... which I will not ask questions about not that I've looked :blush: :blush: :blush: ) to content with the latest updates.
@@burt yes I've not updated to the latest changes (still struggling with sourcetree - maybe more time this weekend).
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
That will cause issues as the existing navigation module is built to be outside the container structure. You need to do something slightly different with an "internal" navbar, add a couple of clearfix div's (one before the first line of code in the template file, one after the last the line of code) which might be enough to get the look in place. Won't be perfect as it's trying to ram a oval peg into a round hole (ie, nearly there but not quite). Hope it makes sense?
-
PupStar reacted to greasemonkey in Responsive osCommerce - Bootstrap
@@PupStar
No its a box module not a content module.
I quickly hacked up a navigation logo "content" module and now I can place (via sort order) before or after the cm_navbar.
I'm happy to share but would definitely want someone with more experience to check it over.
-
PupStar reacted to De Dokta in 2.3.4 Bootstrap Category Tree Display
Hi
You could give gadlols alternative categories navigation a try: http://forums.oscommerce.com/topic/397547-tep-draw-categories-tree-finally-no-recursion-just-one-mysql-query/
J.J.
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
https://github.com/gburton/osCommerce-234-bootstrap/commits/master
@@PupStar
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
Font Awesome is now introduced.
Footer is now content modular.
-
PupStar reacted to burt in Responsive osCommerce - Bootstrap
Team work for the community, I hope that @@bruyndoncx @@auzStar and @@mattjt83 get some thank you's.
Equal Heights module now ships with Core - doesn't need to be turned on if you don't need it, as the core code only gets screwy for those with odd shaped images or long product names.
https://github.com/gburton/osCommerce-234-bootstrap/commit/60701bef1b0dd150cfe666e62d2159006bea7b67
Please note that if you want to have this in your shop and just want to do this change, there are in fact TWO new files, and TWO updated files. Once done, go admin > modules > header tags > install > "equal heights divs (jquery)"
-
PupStar reacted to De Dokta in 234BS New Products Module
Hi
several ways for equal height you find here: http://forums.oscommerce.com/topic/397852-bootstrap-3-in-23-new-products-rows-aligning/
J.J.
-
PupStar reacted to Tsimi in 234BS New Products Module
Hi Mark
If I'm not mistaken you have to play with the col-xx-xx class setting inside the includes/modules/new_products.php file.
Look for this piece of code around line 25-26
while ($new_products = tep_db_fetch_array($new_products_query)) { $new_prods_content .= '<div class="col-sm-6 col-md-4">'; and change for example the number col-md-4 to col-md-3 (4 products per row) or col-md-2 (6 products per row). The problem that you might encounter is that the name of the product might be too long and break one line down and therefore result in different height sizes and that again results in uneven sizes of boxes that can't align correctly. To fix that you will have to define certain sizes % or px inside the css file.
I have no clue how to achieve 5 products per row though, sorry.
-
PupStar reacted to GLWalker in 234BS New Products Module
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