Jump to content

PupStar

Members
  • Content count

    896
  • Joined

  • Last visited

  • Days Won

    10

Posts posted by PupStar


  1. Hi Mark I've received the files.

     

    1 - This must be because of the way the navbar assigns the buttons to each group. Will try to find how can be reordered.

     

    2 - I believe this one is because some buttons are pure buttons and other are links. It can be overriden by putting fixed height on css for each element.

     

    3- You have to apply padding to the navbar-header group that contains the buttons.

     

    @@piernas

     

     

    2 - I believe this one is because some buttons are pure buttons and other are links. It can be overriden by putting fixed height on css for each element.

     

    OK thanks, I have now sorted the button height by adding this to user.css

    .button-height {height: 40px;}
    

    and only adding the class to the buttons not in the standard addon

     

    did you have any luck with the reorder issue

     

    Mark


  2. @@piernas

     

    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

    @@piernas

     

    still not resolved issue 1 and 2 above, any chance you could revisit and advise?

     

    Thanks

     

    Mark


  3. @@piernas

     

    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

    post-256780-0-71666900-1483014353_thumb.png

    post-256780-0-86499500-1483014360_thumb.png


  4. @@piernas

     

    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');
          }
        }
    

  5. 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.

     

    @@piernas

     

    I have tried the code above but nothing shows either on desktop or mobile???

     

    Mark


  6.  

    @piernas

     

    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


  7. 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.

    @@aurelou

     

    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


  8. @piernas

     

    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>');
    

  9. @@piernas

     

    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

    @@piernas

     

    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.


  10. @@PupStar O'm no sure if I understand you. You mean you wnat those buttons in header instead of in the navbar?

     

    @@piernas

     

    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

    post-256780-0-48500200-1480195158_thumb.png


  11. 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.


  12. @@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

     

    @@Dan Cole

     

    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


  13. @@Dan Cole

     

    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

×