

PupStar
-
Content count
896 -
Joined
-
Last visited
-
Days Won
10
Posts posted by PupStar
-
-
-
ok I have created another button called 'Home' using the same principles applied to the spare_parts button.
Now 3 issues I can not seem to solve:
1. The sort order does not stay in the same position from desktop to mobile view
2. All of the buttons are not the same height, any ideas on how to make them all the same size
3. I can not seem to see how to add some padding above the mobile buttons
See attached screenshots.
Thanks
Mark
still not resolved issue 1 and 2 above, any chance you could revisit and advise?
Thanks
Mark
-
ok I have created another button called 'Home' using the same principles applied to the spare_parts button.
Now 3 issues I can not seem to solve:
1. The sort order does not stay in the same position from desktop to mobile view
2. All of the buttons are not the same height, any ideas on how to make them all the same size
3. I can not seem to see how to add some padding above the mobile buttons
See attached screenshots.
Thanks
Mark
-
I have solved the issue of the link/button not showing, half of the __construct function was missing :thumbsup:
function __construct() { $this->title = MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE; $this->description = MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION; if ( defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS') ) { $this->sort_order = MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER; $this->enabled = (MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS == 'True'); } }
ArtcoInc reacted to this -
-
sorry to bug you at this time of year but I dont suppose you have had chance to give your code the once over have you?
I have had a go but not sure why it will not display :wacko:
-
-
-
So if I understand well you want a button that does not contain any dropdown menu (like contact us) and that does not belong to the hamburger menu on mobile view (unlike contact us). Please try this:
Module:
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class nbx_spare_parts { var $code = 'nbx_spare_parts'; var $group = 'navbar_extra_modules_buttons'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE; $this->description = MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION; } function getOutput() { global $oscTemplate; // ob_start(); require('includes/modules/navbar_extra_modules/templates/nbx_spare_parts.php'); $oscTemplate->addBlock($button_mobile, 'navbar_extra_modules_buttons'); $oscTemplate->addBlock($button_desktop, 'navbar_extra_modules_left'); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_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 New products Module', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'True', 'Do you want to add the module to your Navbar?', '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, date_added) values ('Sort Order', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER', '550', '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_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER'); } }
Template:
<?php // This is the button that shows when the navbar is on a mobile view: $button_mobile ='<a type="button" id="btn-wrench" class="btn-primary navbar-toggle" href="' . tep_href_link("parts_finder.php?filterid=1") . '"> <i class="fa fa-wrench"></i> </a>'; // This is the button that shows when the navbar is on desktop view(on the left side): $button_desktop = '<li><a href="' . tep_href_link('parts_finder.php?filterid=1') . '"><i class="fa fa-wrench"></i><span class="hidden-sm"> ' . MODULE_NAVBAR_EXTRA_SPARE_PARTS_PUBLIC_TEXT . '</span></a></li>';
This example generates two different buttons with the same contents that shows in one case or another. One icon will show at the right of the logo on expanded view (and hide on mobile); The other will show between the logo and the hamburger button (only on mobile view and hide on desktop view).
The position of both icons are fixed so the config part with the position (MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT) has been removed.
I have tried the code above but nothing shows either on desktop or mobile???
Mark
-
ok I think I got the hang of this now.
I have created a new module by copying the contact_us module and changed it to what I want.
Now the bit I just can not seem to get my head around is how to make the full link I have degrade to just an icon like the search, cart or account link but without the collapsible part.
Maybe I am being blind but I just can not see how to do it.
Thanks
Mark
includes/modules/navbar_extra_modules/nbx_spare_parts.php
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class nbx_spare_parts { var $code = 'nbx_spare_parts'; var $group = 'navbar_extra_modules_left'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE; $this->description = MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION; if ( defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS') ) { $this->sort_order = MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER; $this->enabled = (MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS == 'True'); switch (MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT) { case 'Home': $this->group = 'navbar_extra_modules_home'; break; case 'Left': $this->group = 'navbar_extra_modules_left'; break; case 'Right': $this->group = 'navbar_extra_modules_right'; break; case 'Buttons': $this->group = 'navbar_extra_modules_buttons'; break; } } } function getOutput() { global $oscTemplate; ob_start(); require('includes/modules/navbar_extra_modules/templates/nbx_spare_parts.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_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 New products Module', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'True', 'Do you want to add the module to your Navbar?', '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 Placement', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT', 'Left', 'Choose placement.', '6', '1', 'tep_cfg_select_option(array(\'Left\',\'Right\'), ', 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_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER', '550', '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_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER'); } }
includes/modules/navbar_extra_modules/templates/nbx_spare_parts.php
<li><a href="<?= tep_href_link('parts_finder.php?filterid=1') ?>"><i class="fa fa-wrench"></i><span class="hidden-sm"> <?= MODULE_NAVBAR_EXTRA_SPARE_PARTS_PUBLIC_TEXT ?></span></a></li>
includes/languages/english/modules/navbar_extra_modules/nbx_spare_parts.php
<?php define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE', 'Spare Parts Finder'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION', 'Show link to Spare Parts Finder in the navigation bar.'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_PUBLIC_TEXT', 'Spare Parts Finder'); //<li><a href="' . tep_href_link('parts_finder.php?filterid=1') . '"><i class="fa fa-wrench"></i><span class="hidden-sm"> Spare Parts Finder</span></a></li>'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_SHORT_TEXT', 'Spare Parts Finder'); //<li><a href="' . tep_href_link('parts_finder.php?filterid=1') . '"><i class="fa fa-wrench"></i><span class="hidden-sm"> Spare Parts Finder</span></a></li>');
@piernas
I still have not worked this out if you woud not mind helping out.
Thanks
Mark
-
Hello @@piernas thank you for this great module.
All is find visually but in mobile view the links don't work on the buttons. I click and nothing happend, it's the same for all button modules (search, account, cart...).
The other links which are not buttons work. I have the new EDGE version, don't know if it's related to the bug.
I can only replicate this problem when viewing the my site using a responsive site tester I have installed in chrome.
If I view the site on my Samsung mobile or Lenovo tablet the buttons work ok.
How are you viewing your site?
Mark
-
@@PupStar I'm sure... have you added the code to your user.css?
Then look in the template file for the new product module (I presume the content module is what you are looking to change?)
yeah done that now thanks, not sure what I was doing wrong lol
-
Sorry to resurrect an old thread but is it possible to get this working with the new products module on the index page?
I have tried but it does not seem to change anything
Thanks
Mark
-
ok I think I got the hang of this now.
I have created a new module by copying the contact_us module and changed it to what I want.
Now the bit I just can not seem to get my head around is how to make the full link I have degrade to just an icon like the search, cart or account link but without the collapsible part.
Maybe I am being blind but I just can not see how to do it.
Thanks
Mark
includes/modules/navbar_extra_modules/nbx_spare_parts.php
<?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ class nbx_spare_parts { var $code = 'nbx_spare_parts'; var $group = 'navbar_extra_modules_left'; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->title = MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE; $this->description = MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION; if ( defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS') ) { $this->sort_order = MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER; $this->enabled = (MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS == 'True'); switch (MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT) { case 'Home': $this->group = 'navbar_extra_modules_home'; break; case 'Left': $this->group = 'navbar_extra_modules_left'; break; case 'Right': $this->group = 'navbar_extra_modules_right'; break; case 'Buttons': $this->group = 'navbar_extra_modules_buttons'; break; } } } function getOutput() { global $oscTemplate; ob_start(); require('includes/modules/navbar_extra_modules/templates/nbx_spare_parts.php'); $data = ob_get_clean(); $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_NAVBAR_EXTRA_SPARE_PARTS_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 New products Module', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'True', 'Do you want to add the module to your Navbar?', '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 Placement', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT', 'Left', 'Choose placement.', '6', '1', 'tep_cfg_select_option(array(\'Left\',\'Right\'), ', 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_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER', '550', '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_NAVBAR_EXTRA_SPARE_PARTS_STATUS', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_CONTENT_PLACEMENT', 'MODULE_NAVBAR_EXTRA_SPARE_PARTS_SORT_ORDER'); } }
includes/modules/navbar_extra_modules/templates/nbx_spare_parts.php
<li><a href="<?= tep_href_link('parts_finder.php?filterid=1') ?>"><i class="fa fa-wrench"></i><span class="hidden-sm"> <?= MODULE_NAVBAR_EXTRA_SPARE_PARTS_PUBLIC_TEXT ?></span></a></li>
includes/languages/english/modules/navbar_extra_modules/nbx_spare_parts.php
<?php define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_TITLE', 'Spare Parts Finder'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_DESCRIPTION', 'Show link to Spare Parts Finder in the navigation bar.'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_PUBLIC_TEXT', 'Spare Parts Finder'); //<li><a href="' . tep_href_link('parts_finder.php?filterid=1') . '"><i class="fa fa-wrench"></i><span class="hidden-sm"> Spare Parts Finder</span></a></li>'); define('MODULE_NAVBAR_EXTRA_SPARE_PARTS_SHORT_TEXT', 'Spare Parts Finder'); //<li><a href="' . tep_href_link('parts_finder.php?filterid=1') . '"><i class="fa fa-wrench"></i><span class="hidden-sm"> Spare Parts Finder</span></a></li>');
-
I moved the original navbar from 'includes/modules/navbar_modules' into 'includes/modules/content/header' so the navbar was constrained to the width of the body and not taking the full page width to fit with my design.
That is what I also want to do with your new navbar, does that make more sense?
Mark
ok I sorted it. instead of having a 'content/navigation' folder I copied the cm_navbar_extra.php file into the content/header folder and it worked. I must have made a mistake earlier when doing that so now it works.
-
@@PupStar O'm no sure if I understand you. You mean you wnat those buttons in header instead of in the navbar?
I moved the original navbar from 'includes/modules/navbar_modules' into 'includes/modules/content/header' so the navbar was constrained to the width of the body and not taking the full page width to fit with my design.
That is what I also want to do with your new navbar, does that make more sense?
Mark
-
I need to have these modules inside the 'header' so the width is constrained to the width of the store and not full page width.
Is it just a simple case of moving to the header module folder or would it require more than that.
I have been playing with this but keep breaking it lol
Thanks
Mark
-
-
this maybe a daft question but why are you upgrading and not just install the responsive version?
-
-
Hello,
the product images not showing but there are on the database and the uploading work also to the server. and when I open the product image link on new tab
it show this error
Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. Error 500
i am not sure if it is ..htaccess file but delete it was and re-upload new one was not help..
ocs 2.3 edge
any help
have you made any changes to the store or is it a stock install?
The usual culprits are .htacces, permissions or coding mistake.
a bit more info is needed.
-
@@PupStar Mark...I'll leave you to it but I have a tip for you. When I struggle with a query I find it helpful to lay it out in this format.
$sql = "SELECT DISTINCT c.customers_email_address, c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_newsletter FROM ". TABLE_ORDERS . " o INNER JOIN ". TABLE_ORDERS_PRODUCTS ." op ON (o.orders_id = op.orders_id) LEFT JOIN ". TABLE_CUSTOMERS . " c ON (o.customers_id = c.customers_id) LEFT JOIN " . TABLE_ORDERS_STATUS_HISTORY . " s ON (o.orders_id = s.orders_id) INNER JOIN ". TABLE_PRODUCTS ." p ON (op.products_id = p.products_id) LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON (p2c.products_id = p.products_id) WHERE o.orders_status = s.orders_status_id AND s.orders_status_id = '" . (int)$status . "' AND s.date_added >= '" . $date_from . "' AND s.date_added <= '" . $date_to . "' AND p.products_model LIKE '" . $sku . "' GROUP BY o.orders_id DESC ";
Dan
Cheers mate as soon as I saw the query again I knew what I had done wrong, the query now looks like this
// We show them all $listing_sql = "select " . $select_column_list . " p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m where c.categories_status = '1' and p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"; }
and thanks for the top top in breaking it down to be more manageable :thumbsup:
Mark
-
-
ok spoke to soon :blush:
I am having problems with the code in index.php for the manufacturers, I have modified the query to this
// We show them all $listing_sql = "select " . $select_column_list . " p.products_id, SUBSTRING_INDEX(pd.products_description, ' ', 20) as products_description, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c using(categories_id) where c.categories_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'"; }
but this produces the error
1054 - Unknown column 'p.products_id' in 'on clause'
select count(p.products_id) as total from products p left join specials s on p.products_id = s.products_id, products_description pd, manufacturers m left join products_to_categories p2c on p.products_id = p2c.products_id left join categories c using(categories_id) where c.categories_status = '1' and pd.products_id = p.products_id and pd.language_id = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '11'
[TEP STOP]now am I correct in thinking that this is because the product_id is not in the manufacturers table? and if 'yes' then what is the solution because I honestly have no idea!
Regards
Mark
Navbar button shown in small view - how to?
in osCommerce Online Merchant Community Bootstrap Edition
Posted
@@piernas
OK thanks, I have now sorted the button height by adding this to user.css
and only adding the class to the buttons not in the standard addon
did you have any luck with the reorder issue
Mark