Jump to content

PupStar

Members
  • Content count

    896
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by PupStar

  1. @@Dan Cole I will take another look this evening Thanks
  2. @@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 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
  3. @@Dan Cole More of a Ronald Weasley than a Harry Potter mate lol
  4. @@Dan Cole I was trying the same sort of thing from other queries I found, however yours seem to do the trick on the top level category. Once I had gone in and turned off the sub categories and products it worked like a charm :thumbsup: I have also applied it to the index new products module (w00t) Eternally grateful for giving clarity to my befuddled brain lol :- Mark Mark
  5. I have spent hours looking and trying things and I am no bloomin further forward. Any of the gurus available to chip in? Thanks Mark
  6. queries are not my forte but I had a go at changing the producs_new.php query by joining the category table but it just throws an error $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_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_CATEGORIES . " c using(categories_id) where p.products_id = pd.products_id and products_status = '1' and categories_status = 1 and pd.language_id = '" . (int)$languages_id . "'"; As I previously said I am not even sure I am modifying the right query in the right file lol
  7. @@Dan Cole Thanks Dan, I knew its was not going to be an easy one when I started lol This is the query from products_new.php although I am not entirely sure it is that query that should be changed $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_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'"; Regards Mark
  8. @@burt I like that idea and will look into it although @@frankl will probably beat me to it with his lightening coding skills (w00t) Mark
  9. @@frankl Strange as I can add multiple lines in the administration with no problems. The amount of lines are set in admin configuration. Default is 6. I will test again in the morning to make sure it is working correctly
  10. @@frankl your on fire today pal I will get my 2 penneth in while I can lol change the 'go' button and 'reset' code in bm_year_make_model.php to '<div class="text-center"><a class="btn btn-primary" href="' . $link . '" role="button">Reset</a></div></form>';
  11. @@frankl blimey that was quick, I only went for a pee lol Cheers
  12. @@frankl on it if I can stay awake tonight lol Also I think the 'Go' button is redundant now and should go, what do you think? me too :thumbsup:
  13. @@frankl I just fixed the cosmetics you did the tricky stuff my friend :thumbsup: I will not go and try tackle the dropdowns to make them visually BS (w00t) Not sure why dropdown 3 & 4 lose there formating when selecting 'Make' Mark
  14. @@frankl ok try the attached file for fixing the columns please explain as not sure what you mean? index.php
  15. @@frankl forget the last post and try this file instead now the only issue that I can see is that if you click on a category in the categories box, if it has sub cats it displays fine however when you drill down to the product listing the layout is screwed up. I have broke the <div> somewhere along the line urgh index.php
  16. @@frankl I think I have got it woohoo! try this new index.php and let me know your thoughts. Mark index.php
  17. @@frankl it is meant to display the matching products using the product listing. I have given my code the once over and the problem is either in one of two places either in the index.php (which I think it is as I dont think I have coded that correctly) or in includes>modules>content>index_nested>cm_in_category_listing.php The install instructions say this
  18. @@frankl I have reworked the product_info.php code for BS and also so that if there are no matches then it does not show the table , just replace the code <?php if (YMM_DISPLAY_DATA_ON_PRODUCT_INFO_PAGE == 'Yes'){ if (isset($HTTP_GET_VARS['products_id']) && $HTTP_GET_VARS['products_id'] != ''){ $q = tep_db_query("select * from products_ymm where products_id = ". (int) $HTTP_GET_VARS['products_id']); if (tep_db_num_rows($q) > 0) { ?> <div class = "table-responsive"> <div class="panel panel-default"> <div class="panel-heading"><?php echo TEXT_PRODUCTS_CAR_HEADING; ?></div> <table class = "table table-bordered"> <thead> <tr> <th><?php echo TEXT_PRODUCTS_CAR_MAKE; ?></th> <th><?php echo TEXT_PRODUCTS_CAR_MODEL; ?></th> <th><?php echo TEXT_PRODUCTS_CAR_PART; ?></th> <th><?php echo TEXT_PRODUCTS_CAR_YEARS; ?></th> </tr> </thead> <?php while ($r = tep_db_fetch_array($q)) { echo '<div id="ymmopt"><tbody><tr><td>' . ($r['products_car_make'] != '' ? $r['products_car_make'] : 'all') . '</td> <td>' . ($r['products_car_model'] != '' ? $r['products_car_model'] : 'all') . '</td> <td>' . ($r['products_car_part'] != '' ? $r['products_car_part'] : 'all') . '</td> <td>' . $r['products_car_year_bof'] . ' - ' . $r['products_car_year_eof'].'</td></tr></tbody></div>'; } ?> </table> </div> </div> <?php } } ?> <div style="clear: both;"></div> <?php } ?>
  19. @@frankl cheers mate, I will have another look this evening as I have a full day at work today. Thanks Mark
  20. I have managed to sort of resolve the delete issue by changing the above code to if ($_POST['ymm_count'] > 0){ $i=1; for($i=1;$i <= $_POST['ymm_count'];$i++){ if(isset($_POST['delete_ymm_'.$i])) $ids .= ($ids != '' ? ',' : '') . $_POST['delete_ymm_'.$i]; } tep_db_query("delete from products_ymm where id = '" . (int)$ids . "'"); } the only problem with this is it will only delete 1 row at a time from the database, if I check 2 boxes or more then the delete fails and does nothing.
  21. @@Tsimi I did have this running years ago on RC2.2 I am using the Dunweb version as all of the code is annotated by him still totaly lost on hooks lol found this earlier and sorted it, thanks Mark
  22. @@frankl Thanks for having a look. I have narrowed down the above error to these lines of code in admin>categories.php starting at line 258 if ($_POST['ymm_count'] > 0){ $i=1; for($i=1;$i <= $_POST['ymm_count'];$i++){ if(isset($_POST['delete_ymm_'.$i])) $ids .= ($ids != '' ? ',' : '') . $_POST['delete_ymm_'.$i]; } tep_db_query("delete from products_ymm where id in ($ids)"); } now if you comment out the lines it works spot on. Regarding the box it now defaults to 'BMW' and not 'Make'. It does fill the 'Model' field and then it stops working with no other drop downs filled.
  23. I am in the process of rebooting the 'Manufacturers logo box' addon into an index module for BS Edge (screenshot attached) http://addons.oscommerce.com/info/4621 The files are as follows includes/modules/content/index/cm_i_manufacturers_logos.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 cm_i_manufacturers_logos { var $code; var $group; var $title; var $description; var $sort_order; var $enabled = false; function __construct() { $this->code = get_class($this); $this->group = basename(dirname(__FILE__)); $this->title = MODULE_CONTENT_MANUFACTURERS_LOGOS_TITLE; $this->description = MODULE_CONTENT_MANUFACTURERS_LOGOS_DESCRIPTION; $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>'; if ( defined('MODULE_CONTENT_MANUFACTURERS_LOGOS_STATUS') ) { $this->sort_order = MODULE_CONTENT_MANUFACTURERS_LOGOS_SORT_ORDER; $this->enabled = (MODULE_CONTENT_MANUFACTURERS_LOGOS_STATUS == 'True'); } } function execute() { global $oscTemplate, $PHP_SELF; $content_width = MODULE_CONTENT_MANUFACTURERS_LOGOS_CONTENT_WIDTH; $product_width = MODULE_CONTENT_MANUFACTURERS_LOGOS_DISPLAY_EACH; $fullstring = '<table width=95% border=0 cellpadding=0 cellspacing=0 align="center"><tr>'; $row=0; $manufacturers_query = tep_db_query("select manufacturers_name, manufacturers_id, manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_image not like '' order by manufacturers_name" ); if (tep_db_num_rows($manufacturers_query) >= '1') { while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $row++; $fullstring .= '<td>'; $fullstring .= '<a href=' . tep_href_link('index.php', 'manufacturers_id=' . $manufacturers['manufacturers_id'] , 'NONSSL', false) . '>'; if ($manufacturers['manufacturers_image']) { $fullstring .= '<img src='. 'images/' . $manufacturers['manufacturers_image'] . '> '; } else { $fullstring .= '<a href=' . tep_href_link('index.php', 'manufacturers_id=' . $manufacturers['manufacturers_id'], 'NONSSL', false) . '>'. $manufacturers['manufacturers_name']; } $fullstring .= '</a>'; $fullstring .= '</td>'; if ((($row / 5) == (double)floor($row / 5))) { $fullstring .='<tr>'; } } $fullstring .= '</td></tr></table>'; ob_start(); include('includes/modules/content/' . $this->group . '/templates/manufacturers_logos.php'); $template = ob_get_clean(); $oscTemplate->addContent($template, $this->group); } } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_CONTENT_MANUFACTURERS_LOGOS_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_CONTENT_MANUFACTURERS_LOGOS_STATUS', 'True', 'Do you want to enable this 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_MANUFACTURERS_LOGOS_CONTENT_WIDTH', '12', 'What width container should the content be shown in? (12 = full width, 6 = half width).', '6', '2', '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_MANUFACTURERS_LOGOS_SORT_ORDER', '300', 'Sort order of display. Lowest is displayed first.', '6', '5', now())"); } function remove() { tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_CONTENT_MANUFACTURERS_LOGOS_STATUS', 'MODULE_CONTENT_MANUFACTURERS_LOGOS_CONTENT_WIDTH', 'MODULE_CONTENT_MANUFACTURERS_LOGOS_SORT_ORDER'); } } includes/modules/content/index/templates/manufacturers_logos.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ ?> <div class="col-sm-<?php echo $content_width; ?>"><?php echo $fullstring;?></div> includes/languages/english/modules/content/index/cm_i_manufacturers_logos.php <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2016 osCommerce Released under the GNU General Public License */ const MODULE_CONTENT_MANUFACTURERS_LOGOS_TITLE = 'Manufacturers Logos'; const MODULE_CONTENT_MANUFACTURERS_LOGOS_DESCRIPTION = 'Shows the "Manufacturers Logos" module on your Index page.'; The only trouble I am having is converting the <table> to a <div> Would anyone like to chime in and have a stab at it. Once complete I will upload to the addons site. Thanks Mark
  24. I have uploaded this as an addon now for download from here http://addons.oscommerce.com/info/9523 Regards Mark
  25. ok I have got the full screen display looking how I want it. The problem I have now is with the smaller view ports, screenshots attached. Any help would be appreciated. includes/modules/navbar_modules/templates/account.php <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo (tep_session_is_registered('customer_id')) ? sprintf(MODULE_NAVBAR_ACCOUNT_LOGGED_IN, $customer_first_name) : MODULE_NAVBAR_ACCOUNT_LOGGED_OUT; ?></a> <ul class="dropdown-menu"> <li> <div class="navbar-login"> <div class="col-lg-3 login-icon"><?php echo MODULE_TEXT_LOGIN_BOX;?></div> <div class="col-lg-9"> <p> <?php if (tep_session_is_registered('customer_id')) {?> <ul> <li><?php echo '<a href="' . tep_href_link('account.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link('account_history.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_HISTORY . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link('address_book.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link('account_password.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_PASSWORD . '</a>'; ?></li> </ul> <?php }else{ ?> <ul> <?php echo '<li class="login-button"><a class="btn btn-success btn-sm btn-block" role="button" href="' . tep_href_link('login.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_LOGIN . '</a></li>'; echo '<li class="login-button"><a class="btn btn-primary btn-sm btn-block" role="button" href="' . tep_href_link('create_account.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_REGISTER . '</a></li>'; ?> </ul> <?php } ?> </p> </div> </div> </li> <li> <div class="navbar-login navbar-login-session"> <div class="col-lg-10"> <p> <ul> <?php if (tep_session_is_registered('customer_id')) { echo '<li><a class="btn btn-danger btn-sm btn-block" role="button" href="' . tep_href_link('logoff.php', '', 'SSL') . '">' . MODULE_NAVBAR_ACCOUNT_LOGOFF . '</a></li>'; }?> </p> </div> </div> </li> </ul> user.css .navbar-login {width: 285px; padding-top: 6px;} ul.login-icon {padding-left: 0px;} li.login-icon {width: 50px;} li.login-button {padding: 4px;} includes/languages/english/modules/navbar_modules/nb_account.php define('MODULE_NAVBAR_ACCOUNT_TITLE', 'Account'); define('MODULE_NAVBAR_ACCOUNT_DESCRIPTION', 'Show Customer Account Actions in Navbar.'); define('MODULE_NAVBAR_ACCOUNT_LOGGED_OUT', '<i class="fa fa-user-circle-o"></i><span class="hidden-sm"> My Profile</span> <span class="caret"></span>'); define('MODULE_NAVBAR_ACCOUNT_LOGGED_IN', '<i class="fa fa-user-circle-o"></i> %s <span class="caret"></span>'); define('MODULE_NAVBAR_ACCOUNT_LOGIN', '<i class="fa fa-sign-in"></i> Sign In'); define('MODULE_NAVBAR_ACCOUNT_LOGOFF', '<i class="fa fa-sign-out"></i> Sign Out'); define('MODULE_NAVBAR_ACCOUNT', '<i class="fa fa-user-circle-o"></i> My Profile'); define('MODULE_NAVBAR_ACCOUNT_HISTORY', '<i class="fa fa-file-text-o"></i> My Orders'); define('MODULE_NAVBAR_ACCOUNT_EDIT', 'My Details'); define('MODULE_NAVBAR_ACCOUNT_ADDRESS_BOOK', '<i class="fa fa-address-book-o"></i> My Address Book'); define('MODULE_NAVBAR_ACCOUNT_PASSWORD', '<i class="fa fa-key"></i> My Password'); define('MODULE_NAVBAR_ACCOUNT_REGISTER', '<i class="fa fa-user-plus"></i> Create Profile'); define('MODULE_TEXT_LOGIN_BOX', '<i class="fa fa-user-circle-o" style="padding: 7px;font-size:87px;color:#c9c9c9;"></i>');
×