Jump to content

PupStar

Members
  • Content count

    896
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by PupStar

  1. PupStar

    Printer Ink & Toner Filter

    @@Tsimi the catalog side is this <?php require('includes/application_top.php'); if(isset($_REQUEST['filterid'])&&($_REQUEST['filterid']!='')) { $filterid = $_REQUEST['filterid']; $filterquery = tep_db_query("select * from ".TABLE_PRINTER_CATEGORY." where parent_id = '0' AND printer_category_id = '".$filterid."'"); if(tep_db_num_rows($filterquery)>0) { $showfilter = true; } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FILTER_PRINTER); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FILTER_PRINTER_FINDER)); require(DIR_WS_INCLUDES . 'template_top.php'); $printerid = 0; if(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='showlist')) { $printerid= $_REQUEST['parts_cat_'.$filterid]; } elseif(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='searchlist')) { $vehidrow = @mysql_fetch_array(mysql_query("SELECT printer_category_name, printer_category_id, categories_image FROM ".TABLE_PRINTER_CATEGORY." where category_name = '".$_REQUEST['keywords']."'")); $vehidrow = tep_db_fetch_array($query); if($vehidrow['printer_category_id']!='') { $printerid= $vehidrow['printer_category_id']; $printerid= $vehidrow['categories_image']; } } $catimage_query = tep_db_query("select categories_image, category_image_name FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$printerid."'"); ?> <?php if($showfilter) { ?> <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-sm-3"><?php getprintercatoptions($filterid); ?></div> <div class="col-sm-9"><?php echo TEXT_PARTS_FINDER_DESCRIPTION;?></div> </div> </div> </div> </div> <?php $define_list = array('PARTS_PRODUCT_LIST_MEDIACAT_PART_NO' => PARTS_PRODUCT_LIST_MEDIACAT_PART_NO, 'PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY' => PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY, 'PARTS_PRODUCT_LIST_MODEL' => PARTS_PRODUCT_LIST_MODEL, 'PARTS_PRODUCT_LIST_NAME' => PARTS_PRODUCT_LIST_NAME, 'PARTS_PRODUCT_LIST_IMAGE_ICON' => PARTS_PRODUCT_LIST_IMAGE_ICON, 'PARTS_PRODUCT_LIST_MANUFACTURER' => PARTS_PRODUCT_LIST_MANUFACTURER, 'PARTS_PRODUCT_LIST_PRICE' => PARTS_PRODUCT_LIST_PRICE, 'PARTS_PRODUCT_LIST_QUANTITY' => PARTS_PRODUCT_LIST_QUANTITY, 'PARTS_PRODUCT_LIST_WEIGHT' => PARTS_PRODUCT_LIST_WEIGHT, 'PARTS_PRODUCT_LIST_BUY_NOW' => PARTS_PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PARTS_PRODUCT_LIST_MEDIACAT_PART_NO': $select_column_list .= 'pd.mediacat_part_no, '; break; case 'PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY': $select_column_list .= 'p.products_mediacat_quantity, '; break; case 'PARTS_PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model, '; break; case 'PARTS_PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'PARTS_PRODUCT_LIST_IMAGE_ICON': $select_column_list .= ''; break; case 'PARTS_PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'PARTS_PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'PARTS_PRODUCT_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case 'PARTS_PRODUCT_LIST_WEIGHT': $select_column_list .= 'p.products_weight, '; break; } } if($printerid>0) { $printercat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$printerid."'"); $printercat_row = tep_db_fetch_array($printercat_query); $productids = $printercat_row['productids']; if($productids!='') { $listing_sql = "select distinct " . $select_column_list . " p.products_id, products_model, p.manufacturers_id, p.products_image, p.products_price, pd.mediacat_part_no, products_name, products_description, products_mediacat_quantity, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and FIND_IN_SET(p.products_id,'".$productids."' )"; //$listing_sql .= " order by pd.mediacat_part_no"; } while ($category_image = tep_db_fetch_array($catimage_query)) { if($productids!='') { ?> <div class="alert alert-success" role="alert"><?php echo '' . $category_image['category_image_name'];?></div> <div class="row"> <div class="col-sm-5"> <div class="panel panel-primary"> <div class="panel-heading"><?php echo TEXT_PANEL_HEADER_PARTS_DIAGRAM;?></div> <div class="panel-body"><?php echo '' . tep_image_parts(DIR_WS_IMAGES_PARTS . $category_image['categories_image'], '', '');?></div> </div> </div> <div class="col-sm-7"> <div class="panel panel-primary"> <div class="panel-heading"><?php echo TEXT_PART_FINDER_LISTING;?></div> <div class="panel-body"> <div class="panel-table"> <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_LIST); ?> </div> </div> </div> </div> <?php } } } } function getprintercatoptions($printer_category_id="",$curprintercatid="") { $fieldid = $printer_category_id; if(isset($_REQUEST['parts_cat_'.$printer_category_id])&&($_REQUEST['parts_cat_'.$printer_category_id]!='')) { $printer_category_id = $_REQUEST['parts_cat_'.$printer_category_id]; $str = getprintercatpath($printer_category_id,""); // change thefollowing add alias of count $query1 = tep_db_query("SELECT count(printer_category_id) as count FROM " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$printer_category_id."'"); $chkbottomROW = tep_db_fetch_array($query1); if($str =="") {$str = "0,";} //change here use alias if($chkbottomROW['count'] > 0) { $str .= $printer_category_id.","; } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); }else{ if($curprintercatid>0) { $str = getprintercatpath($curprintercatid,""); if($str =="") { $str = $curprintercatid.","; }else{ $str .= $curprintercatid.","; } }else{ $str = getprintercatpath($printer_category_id,""); if($str =="") {$str = $printer_category_id.",";} } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); } } function editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid="") { $i=0; $cntvarr = count($catarr); foreach($catarr as $val) { $veh_cat_array = array(array('id' => '', 'text' => 'Select One')); $printers_query = tep_db_query("select * from " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$val."' order by category_name"); if(tep_db_num_rows($printers_query)>0) { while ($printers = tep_db_fetch_array($printers_query)) { $veh_cat_array[] = array('id' => $printers['printer_category_id'], 'text' => $printers['category_name']); } if($cntvarr==$i+1) { $selval = $printer_category_id; }else{ $selval = $catarr[$i+1]; } ?> <?php echo tep_draw_pull_down_menu_parts('parts_cat_'.$val, $veh_cat_array, $selval, 'onchange="document.frmveh.parts_cat_'.$fieldid.'.value=this.value;document.frmveh.submit();"');?> <?php $i++; } } } function getprintercatpath($printer_category_id, $str) { $str1 = $str; $printers_query = tep_db_query("select parent_id from " . TABLE_PRINTER_CATEGORY . " where printer_category_id = '".$printer_category_id."'"); $printers = tep_db_fetch_array($printers_query); $parent_id = $printers['parent_id']; if($parent_id==0) { return $str1; }else{ $str1 .= $parent_id.","; $str1 = getprintercatpath($parent_id, $str1); return $str1; } } ?> <form name="frmveh" action="" method="get"> <input type="hidden" name="parts_cat_<?php echo $filterid;?>" value="<?php echo $_REQUEST['parts_cat_1'];?>"> <input type="hidden" name="filterid" value="<?php echo $filterid;?>" /> <input type="hidden" name="mode" value="showlist" /> </form> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); ?> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> If I remember correctly that part of the query allows me to sort by category name because without it I can not sort by category (I think)
  2. PupStar

    Printer Ink & Toner Filter

    The code I have now is very far from the original its scary. I have everything working except that query urgh
  3. I use Ultimate SEO URLS by Chemo and it works fine http://addons.oscommerce.com/info/2823
  4. @@Tsimi ok I have started from scratch and I think I have found the problem and it lies in the product query. This query works $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRINTER_CATEGORY.' pc where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" and pc.printer_category_id = "'.$printer_category_id.'" order by pd.products_name asc'; but as soon as I add in p.products_id = pc.printer_category_id so the query then looks like this it stops working $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRINTER_CATEGORY.' pc where p.products_id = pd.products_id and p.products_id = pc.printer_category_id and pd.language_id = "'.(int)$languages_id.'" and pc.printer_category_id = "'.$printer_category_id.'" order by pd.products_name asc'; Any ideas why? Mark
  5. Hi Lambros, Thanks for taking the time to have a go. I will revert everything back to the old admin and work forward one step at a time and see if I can get it solved. Thanks again Mark
  6. @@Tsimi Hi Lambros, The code above is the filename_printer_products.php if thats what you meant?? below is the original non BS code thank you for taking time out to look at this for me. Mark <?php /* Parts Filter osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $printer_category_id = $_REQUEST['printer_category_id']; $parent_id = $_REQUEST['parent_id']; if(isset($_REQUEST['printer_category_id'])&&($_REQUEST['printer_category_id']!='')) { $vehcat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$_REQUEST['printer_category_id']."'"); $vehcat_row = tep_db_fetch_array($vehcat_query); } $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); // Ultimate SEO URLs v2.1 // If the action will affect the cache entries if ( preg_match("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php'); if (tep_not_null($action)) { switch ($action) { case 'assign_products': $productids = ""; $mediacat_ref_no = ""; $mediacat_quantity = ""; $selvalarray = array(); $pagearray = array(); $remproductarray = array(); $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRINTER_CATEGORY.' pc where p.products_id = pd.products_id and p.products_id = pc.printer_category_id and pd.language_id = "'.(int)$languages_id.'" and pc.printer_category_id = "'.(int)$printer_category_id.'" order by pd.products_id asc'; $products_query = tep_db_query($products_query_raw); $products_split = new splitPageResults($_REQUEST['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { array_push($pagearray,$products['products_id']); } if(isset($HTTP_POST_VARS['productids'])) { foreach($HTTP_POST_VARS['productids'] as $val) { if($val!='') { array_push($selvalarray,$val); $productids .= $val.","; } } } foreach($pagearray as $val) { if(!in_array($val,$selvalarray)) { array_push($remproductarray,$val); } } $olderdata = $vehcat_row['productids']; $finaldata = ""; if($olderdata!='') { $oldprodarray = explode(",",$olderdata); foreach($oldprodarray as $val) { if(!in_array($val,$remproductarray)) { if(!in_array($val,$selvalarray)) { array_push($selvalarray,$val); } } } $productids = ""; foreach($selvalarray as $val) { $productids .= $val.","; } $finaldata = substr($productids,0,-1); } else { $finaldata = substr($productids,0,-1); } $update_sql_data = array('productids' => $finaldata); tep_db_perform(TABLE_PRINTER_CATEGORY, $update_sql_data, 'update', "printer_category_id = '" . (int)$printer_category_id . "'"); tep_redirect(tep_href_link(FILENAME_PRINTER_PRODUCTS, 'parent_id=' . $parent_id.'&printer_category_id='.$printer_category_id.'&page='.$_REQUEST['page'] )); break; } } // check if the catalog image directory exists if (is_dir(DIR_FS_CATALOG_IMAGES)) { if (!is_writeable(DIR_FS_CATALOG_IMAGES)) $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { $messageStack->add(ERROR_CATALOG_IMAGE_DIRECTORY_DOES_NOT_EXIST, 'error'); } require(DIR_WS_INCLUDES . 'template_top.php'); $vehcat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$_REQUEST['printer_category_id']."'"); $vehcat_row = tep_db_fetch_array($vehcat_query); $prodidsarr = explode(",",$vehcat_row['productids']); ?> <table border="0" align="center" width="85%" cellspacing="2" cellpadding="2"> <tr> <!-- body_text //--> <td width="100%" valign="top"> <table border="0" width="100%" cellspacing="4" cellpadding="0"> <tr> <td> <table border="0" width="80%" cellspacing="2" cellpadding="2"> <tr> <td class="pageHeading"><?php echo HEADING_TITLE." ".$vehcat_row['category_name']; ?></td> <td class="smallText" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_PRINTER_CATEGORY, 'printer_category_id='.$printer_category_id.'&parent_id=' . $parent_id ) . '"><div class="go_back">' . tep_draw_button(IMAGE_GO_BACK, 'arrowreturnthick-1-w', null, 'primary') . '</div></a>';?> </td> <?php echo tep_draw_form('categorie', FILENAME_PRINTER_PRODUCTS, '', 'get'); echo tep_draw_hidden_field( 'row_by_page', $row_by_page);?> <td class="smallText" align="right" valign="top"> </td></form> <td align="right"></td> </tr> </table> </td> </tr> <tr> <td> <table border="0" width="80%" cellspacing="0" cellpadding="0"> <tr> <td valign="top"> <?php echo tep_draw_form('printerfilter', FILENAME_PRINTER_PRODUCTS, 'action=assign_products&parent_id='.$parent_id.'&printer_category_id='.$printer_category_id.'&page='.$_REQUEST['page'], 'post');?> <table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_ID; ?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_MODEL;?></td> <td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_PRODUCT_NAME;?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_CATEGORY_NAME;?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_MEDIACAT_REF_NO;?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_MEDIACAT_QUANTITY;?></td> <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_PRODUCT_SELECT;?></td> </tr> <?php $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by pd.products_id asc'; $products_split = new splitPageResults($_REQUEST['page'], '30', $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { if ( strpos( tep_get_product_path($products['products_id']), "_" ) == FALSE ) { $result = tep_get_category_name( tep_get_product_path( $products['products_id'] ) ); } else { $pieces = explode("_", tep_get_product_path($products['products_id']) ); $categories_array = array(); $categories_array = tep_get_categories( $categories_array, $pieces[0] ); for ( $j = 0 ; $j < count($categories_array) ; $j++ ) { if ( $categories_array[ $j ]['id'] == $pieces[ count( $pieces ) - 1 ] ) { $result = $categories_array[ $j ][ 'text' ]; break; } } } if (empty( $products['products_mediacat_ref_no'] )) { }else{ ?> <tr> <td class="dataTableContentBorder" valign="middle" align="center"><?php echo $products['products_id'];?></td> <td class="dataTableContentBorder" align="center" valign="middle"><?php echo $products['products_model'];?></td> <td class="dataTableContentBorder" valign="middle"><?php echo $products['products_name'];?></td> <td class="dataTableContentBorder" valign="middle" align="center"><?php echo $result; ?></td> <td class="dataTableContentBorder" valign="middle" align="center"><?php echo $products['products_mediacat_ref_no'];?></td> <td class="dataTableContentBorder" valign="middle" align="center"><?php echo $products['products_mediacat_quantity'];?></td> <td class="dataTableContentBorder" valign="middle" align="center"><input type="checkbox" name="productids[]" value="<?php echo $products['products_id'];?>" <?php if(in_array($products['products_id'],$prodidsarr)) echo 'checked';?> /></td> </tr> <?php } } // End of while ?> <div class="assign_parts"><?php echo tep_draw_button(IMAGE_ASSIGN_PARTS, 'disk', null, 'primary'); ?></div> </table></form> </td> </tr> <tr> <td ><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText" valign="top"><?php echo $products_split->display_count($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_REQUEST['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></td> <td class="smallText" align="right"><?php echo $products_split->display_links($products_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_REQUEST['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y', 'cID', 'action'))); ?></td> </tr> </table></td> </tr> </table> </td> </tr> </table> </td> <!-- body_text_eof //--> </tr> </table> <!-- body_eof //--> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
  7. @Tsimi Hi Lambros, I upgraded my admin to your BS version earlier this afternoon and it works great. I do however have one little problem (so far) after converting an existing addon to work with Bootstrap. The code worked perfectly before changing. Its not a massive problem just a button issue I think. I know my button code is not correct but not sure what to change and what parameters to use) to assign a product: 1. click on a checkbox to add the tick 2. click save to unassign a product 1. click on the checkbox to remove the tick 2. click save The current submit does assign the product_id to the database but for some reason does not remove it. would you be so kind to have a look over the following code and let me know if anything jumps out at you as I have been staring at the code all afternoon and still can not sort it. <?php /* Parts Filter osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ require('includes/application_top.php'); $printer_category_id = $_REQUEST['printer_category_id']; $parent_id = $_REQUEST['parent_id']; if(isset($_REQUEST['printer_category_id'])&&($_REQUEST['printer_category_id']!='')) { $vehcat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$_REQUEST['printer_category_id']."'"); $vehcat_row = tep_db_fetch_array($vehcat_query); } $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : ''); // Ultimate SEO URLs v2.1 // If the action will affect the cache entries if ( preg_match("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php'); if (tep_not_null($action)) { switch ($action) { case 'assign_products': $productids = ""; $mediacat_ref_no = ""; $mediacat_quantity = ""; $selvalarray = array(); $pagearray = array(); $remproductarray = array(); $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd, '.TABLE_PRINTER_CATEGORY.' pc where p.products_id = pd.products_id and p.products_id = pc.printer_category_id and pd.language_id = "'.(int)$languages_id.'" and pc.printer_category_id = "'.(int)$printer_category_id.'" order by pd.products_id asc'; $products_query = tep_db_query($products_query_raw); $products_split = new splitPageResults($_REQUEST['page'], MAX_DISPLAY_SEARCH_RESULTS, $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { array_push($pagearray,$products['products_id']); } if(isset($HTTP_POST_VARS['productids'])) { foreach($HTTP_POST_VARS['productids'] as $val) { if($val!='') { array_push($selvalarray,$val); $productids .= $val.","; } } } foreach($pagearray as $val) { if(!in_array($val,$selvalarray)) { array_push($remproductarray,$val); } } $olderdata = $vehcat_row['productids']; $finaldata = ""; if($olderdata!='') { $oldprodarray = explode(",",$olderdata); foreach($oldprodarray as $val) { if(!in_array($val,$remproductarray)) { if(!in_array($val,$selvalarray)) { array_push($selvalarray,$val); } } } $productids = ""; foreach($selvalarray as $val) { $productids .= $val.","; } $finaldata = substr($productids,0,-1); }else{ $finaldata = substr($productids,0,-1); } $update_sql_data = array('productids' => $finaldata); tep_db_perform(TABLE_PRINTER_CATEGORY, $update_sql_data, 'update', "printer_category_id = '" . (int)$printer_category_id . "'"); tep_redirect(tep_href_link(FILENAME_PRINTER_PRODUCTS, 'parent_id=' . $parent_id.'&printer_category_id='.$printer_category_id.'&page='.$_REQUEST['page'] )); break; } } require(DIR_WS_INCLUDES . 'template_top.php'); $vehcat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$_REQUEST['printer_category_id']."'"); $vehcat_row = tep_db_fetch_array($vehcat_query); $prodidsarr = explode(",",$vehcat_row['productids']); ?> <div class="row"> <div class="col-md-8 h3"> <?php echo HEADING_TITLE." ".$vehcat_row['category_name']; ?> </div> <div class="col-md-2"> <?php echo '<a href="' . tep_href_link(FILENAME_PRINTER_CATEGORY, 'printer_category_id='.$printer_category_id.'&parent_id=' . $parent_id ) . '"><div class="go_back">' . tep_draw_button(IMAGE_GO_BACK, 'arrowreturnthick-1-w', null, 'primary') . '</div></a>';?> </div> <div class="col-md-2"> <?php echo tep_draw_form('printerfilter', FILENAME_PRINTER_PRODUCTS, 'action=assign_products&parent_id='.$parent_id.'&printer_category_id='.$printer_category_id.'&page='.$_REQUEST['page'], 'post');?> <?php echo tep_image_submit('button_save.gif', IMAGE_SAVE); ?> </div> </div> <div class="table-responsive"> <table class="table table-condensed table-hover header"> <thead><!-- table head--> <tr> <th><?php echo TABLE_HEADING_PRODUCT_ID; ?></th> <th><?php echo TABLE_HEADING_PRODUCT_MODEL;?></th> <th><?php echo TABLE_HEADING_PRODUCT_NAME;?></th> <th><?php echo TABLE_HEADING_PRODUCT_CATEGORY_NAME;?></th> <th><?php echo TABLE_HEADING_PRODUCT_MEDIACAT_REF_NO;?></th> <th><?php echo TABLE_HEADING_PRODUCT_MEDIACAT_QUANTITY;?></th> <th><?php echo TABLE_HEADING_PRODUCT_SELECT;?></th> </tr> </thead> <tbody> <?php $products_query_raw = 'select distinct p.products_id, p.products_model, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_id, p.products_mediacat_ref_no, p.products_mediacat_quantity from '.TABLE_PRODUCTS.' p, '.TABLE_PRODUCTS_DESCRIPTION.' pd where p.products_id = pd.products_id and pd.language_id = "'.(int)$languages_id.'" order by pd.products_id asc'; $products_split = new splitPageResults($_REQUEST['page'], '70', $products_query_raw, $products_query_numrows); $products_query = tep_db_query($products_query_raw); while ($products = tep_db_fetch_array($products_query)) { if ( strpos( tep_get_product_path($products['products_id']), "_" ) == FALSE ) { $result = tep_get_category_name( tep_get_product_path( $products['products_id'] ) ); } else { $pieces = explode("_", tep_get_product_path($products['products_id']) ); $categories_array = array(); $categories_array = tep_get_categories( $categories_array, $pieces[0] ); for ( $j = 0 ; $j < count($categories_array) ; $j++ ) { if ( $categories_array[ $j ]['id'] == $pieces[ count( $pieces ) - 1 ] ) { $result = $categories_array[ $j ][ 'text' ]; break; } } } ?> <tr> <?php if (empty( $products['products_mediacat_ref_no'] )) { }else{ ?> <td class="col-md-1"><?php echo $products['products_id'];?></td> <td class="col-md-2"><?php echo $products['products_model'];?></td> <td class="col-md-2"><?php echo $products['products_name'];?></td> <td class="col-md-2"><?php echo $result; ?></td> <td class="col-md-1"><?php echo $products['products_mediacat_ref_no'];?></td> <td class="col-md-1"><?php echo $products['products_mediacat_quantity'];?></td> <td class="col-md-1"><input type="checkbox" name="productids[]" value="<?php echo $products['products_id'];?>" <?php if(in_array($products['products_id'],$prodidsarr)) echo 'checked';?> /></td> <?php } } // End of while ?> </tr> </tbody> </table> </div> </form> <!-- body_eof //--> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Thanks Mark
  8. Hi Guys, I am having a bit of trouble finishing off a conversion of a modded version of this contribution http://addons.oscommerce.com/info/7116 Now it works to a degree but I am having trouble with the ajax selection in the dropdowns, basically the script is not triggered when I make the first selection. If I enter the full url http://localhost/printer/parts_finder.php?parts_cat_1=3028&filterid=1&mode=showlist then all dropdowns are filled and data displayed correctly and the view source seems ok <div><select name="parts_cat_1" onchange="document.frmveh.parts_cat_1.value=this.value;document.frmveh.submit();" class="form-control"><option value="">Select One</option><option value="3024" selected="selected">Stihl</option><option value="3025">Viking</option></select></div> <div><select name="parts_cat_3024" onchange="document.frmveh.parts_cat_1.value=this.value;document.frmveh.submit();" class="form-control"><option value="">Select One</option><option value="3026" selected="selected">Chainsaws</option></select></div> <div><select name="parts_cat_3026" onchange="document.frmveh.parts_cat_1.value=this.value;document.frmveh.submit();" class="form-control"><option value="">Select One</option><option value="3027" selected="selected">MS170, MS170 C</option></select></div> <div><select name="parts_cat_3027" onchange="document.frmveh.parts_cat_1.value=this.value;document.frmveh.submit();" class="form-control"><option value="">Select One</option><option value="3028" selected="selected">Air Filter & Shroud</option></select></div> This is the code and the ajaxd.js file that is being called <?php require('includes/application_top.php'); if(isset($_REQUEST['filterid'])&&($_REQUEST['filterid']!='')) { $filterid = $_REQUEST['filterid']; $filterquery = tep_db_query("select * from ".TABLE_PRINTER_CATEGORY." where parent_id = '0' AND printer_category_id = '".$filterid."'"); if(tep_db_num_rows($filterquery)>0) { $showfilter = true; } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FILTER_PRINTER); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_FILTER_PRINTER_FINDER)); require(DIR_WS_INCLUDES . 'template_top.php'); $printerid = 0; if(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='showlist')) { $printerid= $_REQUEST['parts_cat_'.$filterid]; } elseif(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='searchlist')) { $vehidrow = @mysql_fetch_array(mysql_query("SELECT printer_category_name, printer_category_id, categories_image, machine_image FROM ".TABLE_PRINTER_CATEGORY." where category_name = '".$_REQUEST['keywords']."'")); $vehidrow = tep_db_fetch_array($query); if($vehidrow['printer_category_id']!='') { $printerid= $vehidrow['printer_category_id']; $printerid= $vehidrow['categories_image']; } } $catimage_query = tep_db_query("select categories_image, category_image_name, categories_image_large FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$printerid."'"); ?> <?php if($showfilter) { ?> <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-sm-3"><?php getprintercatoptions($filterid); ?></div> <div class="col-sm-9"><?php echo TEXT_PARTS_FINDER_DESCRIPTION;?></div> </div> </div> </div> </div> <div class="bodyContent"> <?php $define_list = array('PARTS_PRODUCT_LIST_MEDIACAT_PART_NO' => PARTS_PRODUCT_LIST_MEDIACAT_PART_NO, 'PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY' => PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY, 'PARTS_PRODUCT_LIST_MODEL' => PARTS_PRODUCT_LIST_MODEL, 'PARTS_PRODUCT_LIST_NAME' => PARTS_PRODUCT_LIST_NAME, 'PARTS_PRODUCT_LIST_IMAGE_ICON' => PARTS_PRODUCT_LIST_IMAGE_ICON, 'PARTS_PRODUCT_LIST_MANUFACTURER' => PARTS_PRODUCT_LIST_MANUFACTURER, 'PARTS_PRODUCT_LIST_PRICE' => PARTS_PRODUCT_LIST_PRICE, 'PARTS_PRODUCT_LIST_QUANTITY' => PARTS_PRODUCT_LIST_QUANTITY, 'PARTS_PRODUCT_LIST_WEIGHT' => PARTS_PRODUCT_LIST_WEIGHT, 'PARTS_PRODUCT_LIST_BUY_NOW' => PARTS_PRODUCT_LIST_BUY_NOW); asort($define_list); $column_list = array(); reset($define_list); while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'PARTS_PRODUCT_LIST_MEDIACAT_PART_NO': $select_column_list .= 'pd.mediacat_part_no, '; break; case 'PARTS_PRODUCT_LIST_MEDIACAT_QUANTITY': $select_column_list .= 'p.products_mediacat_quantity, '; break; case 'PARTS_PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model, '; break; case 'PARTS_PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'PARTS_PRODUCT_LIST_IMAGE_ICON': $select_column_list .= ''; break; case 'PARTS_PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'PARTS_PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'PARTS_PRODUCT_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case 'PARTS_PRODUCT_LIST_WEIGHT': $select_column_list .= 'p.products_weight, '; break; } } if($printerid>0) { $printercat_query = tep_db_query("SELECT * FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$printerid."'"); $printercat_row = tep_db_fetch_array($printercat_query); $productids = $printercat_row['productids']; if($productids!='') { $listing_sql = "select distinct " . $select_column_list . " p.products_id, products_model, p.manufacturers_id, p.products_image, p.products_price, pd.mediacat_part_no, products_name, products_description, products_mediacat_quantity, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and FIND_IN_SET(p.products_id,'".$productids."' )"; $listing_sql .= " order by pd.mediacat_part_no"; } while ($category_image = tep_db_fetch_array($catimage_query)) { if($productids!='') { ?> <div class="row"> <div class="col-sm-5"> <div class="panel panel-primary"> <div class="panel-heading"><?php echo '' . $category_image['category_image_name'];?></div> <div class="panel-body"><?php echo '' . tep_image_parts(DIR_WS_IMAGES_PARTS . $category_image['categories_image'], '', '');?></div> </div> </div> <div class="col-sm-7"> <div class="panel panel-primary"> <div class="panel-heading"><?php echo TEXT_PART_FINDER_LISTING;?></div> <div class="panel-body"> <div class="panel-table"> <?php include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_LIST); } ?> </div> </div> </div> </div> <?php } } } function getprintercatoptions($printer_category_id="",$curprintercatid="") { $fieldid = $printer_category_id; if(isset($_REQUEST['parts_cat_'.$printer_category_id])&&($_REQUEST['parts_cat_'.$printer_category_id]!='')) { $printer_category_id = $_REQUEST['parts_cat_'.$printer_category_id]; $str = getprintercatpath($printer_category_id,""); $query1 = tep_db_query("SELECT count(printer_category_id) FROM " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$printer_category_id."'"); $chkbottomROW = tep_db_fetch_array($query1); if($str =="") {$str = "0,";} if($chkbottomROW[0]>0) { $str .= $printer_category_id.","; } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); }else{ if($curprintercatid>0) { $str = getprintercatpath($curprintercatid,""); if($str =="") { $str = $curprintercatid.","; }else{ $str .= $curprintercatid.","; } }else{ $str = getprintercatpath($printer_category_id,""); if($str =="") {$str = $printer_category_id.",";} } $catarr = explode(",",substr($str,0,-1)); sort($catarr); editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid); } } function editprintercat($catarr,$fieldid,$printer_category_id,$curprintercatid="") { $i=0; $cntvarr = count($catarr); foreach($catarr as $val) { $veh_cat_array = array(array('id' => '', 'text' => 'Select One')); $printers_query = tep_db_query("select * from " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$val."' order by category_name"); if(tep_db_num_rows($printers_query)>0) { while ($printers = tep_db_fetch_array($printers_query)) { $veh_cat_array[] = array('id' => $printers['printer_category_id'], 'text' => $printers['category_name']); } if($cntvarr==$i+1) { $selval = $printer_category_id; }else{ $selval = $catarr[$i+1]; } ?> <div><?php echo tep_draw_pull_down_menu_parts('parts_cat_'.$val, $veh_cat_array, $selval, 'onchange="document.frmveh.parts_cat_'.$fieldid.'.value=this.value;document.frmveh.submit();"');?></div> <?php $i++; } } } function getprintercatpath($printer_category_id, $str) { $str1 = $str; $printers_query = tep_db_query("select parent_id from " . TABLE_PRINTER_CATEGORY . " where printer_category_id = '".$printer_category_id."'"); $printers = tep_db_fetch_array($printers_query); $parent_id = $printers['parent_id']; if($parent_id==0) { return $str1; }else{ $str1 .= $parent_id.","; $str1 = getprintercatpath($parent_id, $str1); return $str1; } } ?> </div> <form name="frmveh" action="" method="get"> <input type="hidden" name="parts_cat_<?php echo $filterid;?>" value="<?php echo $_REQUEST['parts_cat_1'];?>"> <input type="hidden" name="filterid" value="<?php echo $filterid;?>" /> <input type="hidden" name="mode" value="showlist" /> </form> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); ?> <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> // JavaScript Document var req=null; var console=null; var READY_STATE_UNINITIALIZED=0; var READY_STATE_LOADING=1; var READY_STATE_LOADED=2; var READY_STATE_INTERACTIVE=3; var READY_STATE_COMPLETE=4; function sendRequest(url,params,HttpMethod) { if (!HttpMethod) { HttpMethod="POST"; } req=initXMLHTTPRequest(); if (req) { req.onreadystatechange=onReadyState; req.open(HttpMethod,url,true); req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); req.send(params); } } //****************************creating the XMLHTTPRequest object function initXMLHTTPRequest() { var xRequest=null; if (window.XMLHttpRequest) { xRequest=new XMLHttpRequest(); } else if (window.ActiveXObject) { xRequest=new ActiveXObject("Microsoft.XMLHTTP"); } return xRequest; } I have also uploaded a screenshot to see what the end result should look like I would very much appreciate it if someone would help me debug as I am now stuck on this final piece of the puzzle. I am also not sure if it is a conflict with bootstrap or not Thanks Mark
  9. @Bob Terveuren Thank you 'Q' managed to get the formatting problem sorted, it was a misplaced } :thumbsup:
  10. neither are included in the base install. look at the addons under 2.3 for BS ready versions.
  11. @@burt now I see that a different way I click "A" button, the 'A' content opens. I click "B" button, the "A" content closes and the "B" content opens. personal taste I suppose back to google for the .js :-
  12. I am trying to modify the navbar so it looks like the image I have attached, all good so far apart from the search and cart only open when I click the icons in sequence from right to left. Simpy put the navs do not open and close correctly. http://s19.postimg.org/pw3c28mgz/Screenshot_9.png <nav class="navbar navbar-default navbar-no-corners navbar-no-margin" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="btn-icon navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1"> <span class="sr-only"><?php echo HEADER_TOGGLE_NAV; ?></span> <span class="fa fa-align-justify"></span> </button> <button type="button" class="btn-icon navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-2"> <span class="sr-only"><?php echo HEADER_TOGGLE_NAV; ?></span> <span class="fa fa-search"></span> </button> <button type="button" class="btn-icon navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-3"> <span class="sr-only"><?php echo HEADER_TOGGLE_NAV; ?></span> <span class="fa fa-shopping-cart"></span> </button> <a class="hidden-lg navbar-brand" href="#"><?php echo '<a href="' . tep_href_link('index.php') . '">' . tep_image(DIR_WS_IMAGES . STORE_LOGO, STORE_NAME) . '</a>'; ?></a> </div> <div class="collapse navbar-collapse" id="bs-navbar-collapse-1"> <div class="container-fluid hidden-lg"> <ul class="nav navbar-nav"> <?php echo '<li><a href="' . tep_href_link(FILENAME_PRODUCTS_NEW) . '">' . HEADER_WHATS_NEW . '</a></li>'; ?> <?php echo '<li><a href="' . tep_href_link(FILENAME_SPECIALS) . '">' . HEADER_SPECIALS . '</a></li>'; ?> <?php echo '<li><a href="' . tep_href_link(FILENAME_REVIEWS) . '">' . HEADER_REVIEWS . '</a></li>'; ?> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo (tep_session_is_registered('customer_id')) ? sprintf(HEADER_ACCOUNT_LOGGED_IN, $customer_first_name) : HEADER_ACCOUNT_LOGGED_OUT; ?></a> <ul class="dropdown-menu"> <?php if (tep_session_is_registered('customer_id')) { echo '<li><a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . HEADER_ACCOUNT_LOGOFF . '</a>'; } else { echo '<li><a href="' . tep_href_link(FILENAME_LOGIN, '', 'SSL') . '">' . HEADER_ACCOUNT_LOGIN . '</a>'; echo '<li><a href="' . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL') . '">' . HEADER_ACCOUNT_REGISTER . '</a>'; } ?> <li class="divider"></li> <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . HEADER_ACCOUNT . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . HEADER_ACCOUNT_HISTORY . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . HEADER_ACCOUNT_ADDRESS_BOOK . '</a>'; ?></li> <li><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . HEADER_ACCOUNT_PASSWORD . '</a>'; ?></li> </ul> </li> </ul> </div> <div class="collapse navbar-collapse" id="bs-navbar-collapse-2"> <div class="container-fluid hidden-lg"> <ul class="nav navbar-nav navbar-right"> <?php $search_box = '<div class="searchbox-margin">'; $search_box .= tep_draw_form('quick_find', tep_href_link('advanced_search_result.php', '', $request_type, false), 'get', 'class="form-horizontal"'); $search_box .= ' <div class="input-group">' . tep_draw_input_field('keywords', '', 'required placeholder="' . TEXT_SEARCH_PLACEHOLDER . '"') . '<span class="input-group-btn"><button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-search"></i></button></span>' . ' </div>'; $search_box .= '</div>'; $search_box .= tep_hide_session_id() . '</form>'; ?> <li><?php echo $search_box; ?></li> </ul> </li> </ul> </div> <div class="collapse navbar-collapse" id="bs-navbar-collapse-3"> <div class="container-fluid hidden-lg"> <ul class="nav navbar-nav navbar-right"> <?php if ($cart->count_contents() > 0) { ?> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><?php echo sprintf(HEADER_CART_CONTENTS, $cart->count_contents()); ?></a> <ul class="dropdown-menu"> <li><?php echo '<a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . sprintf(HEADER_CART_HAS_CONTENTS, $cart->count_contents(), $currencies->format($cart->show_total())) . '</a>'; ?></li> <?php if ($cart->count_contents() > 0) { echo '<li class="divider"></li>'; echo '<li><a href="' . tep_href_link(FILENAME_SHOPPING_CART) . '">' . HEADER_CART_VIEW_CART . '</a></li>'; } ?> </ul> </li> <?php echo '<li><a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . HEADER_CART_CHECKOUT . '</a></li>'; } else { echo '<li class="nav navbar-text">' . HEADER_CART_NO_CONTENTS . '</li>'; } ?> </ul> </li> </ul> </div> </div> </div> </nav>
  13. @@burt thats better but if I click on the shopping cart and then immediately the search icon the search box is loaded on top of the shopping cart. I was thinking that the shopping cart should close before opening the search box if that makes sense (w00t)
  14. @Bob Terveuren Thanks Bob, that did the trick and it works lovely now (will give it some hammer and try to break it lol) Its strange how the original script worked flawlessly on osc 2.3.2 but not on BS I have one other little issue now and that when you select the first dropdown it breaks the footer (see image), I am presuming its a <div> issue but can not see it. http://s19.postimg.org/t24fidqdf/broken_footer.png
  15. Hi Bob for some reason the uploader wont allow me to attach a zip or txt file urgh, view source pasted below I have googled on how to switch the code out as my js skills are terrible lol Thanks Mark <!DOCTYPE html> <html dir="ltr" lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Parts Finder Development</title> <base href="http://localhost/printer/"> <link href="ext/bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link href="custom.css" rel="stylesheet"> <link href="user.css" rel="stylesheet"> <link href="parts.css" rel="stylesheet"> <link rel="stylesheet" href="ext/bootstrap-magnify/css/bootstrap-magnify.min.css"> <!--[if lt IE 9]> <script src="ext/js/html5shiv.js"></script> <script src="ext/js/respond.min.js"></script> <script src="ext/js/excanvas.min.js"></script> <![endif]--> <script src="ext/jquery/jquery-1.11.1.min.js"></script> <script src="ext/js/ajaxd.js" ></script> <!-- font awesome --> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <noscript><div class="no-script"><div class="no-script-inner"><p><strong>JavaScript seems to be disabled in your browser.</strong></p><p>You must have JavaScript enabled in your browser to utilize the functionality of this website. <a href="http://www.enable-javascript.com/" target="_blank" rel="nofollow">Click here for instructions on enabling javascript in your browser</a>.</div></div></noscript> <style>.no-script { border: 1px solid #ddd; border-width: 0 0 1px; background: #ffff90; font: 14px verdana; line-height: 2; text-align: center; color: #2f2f2f; } .no-script .no-script-inner { margin: 0 auto; padding: 5px; } .no-script p { margin: 0; }</style> </head> <body> <nav class="navbar navbar-inverse navbar-no-corners navbar-no-margin navbar-fixed-top" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1"> <span class="sr-only">Toggle Navigation</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-1"> <div class="container-fluid"> <ul class="nav navbar-nav"> <li><a class="store-brand" href="http://localhost/printer/index.php"><i class="fa fa-home fa-lg"></i><span class="hidden-sm"> Home</span></a></li> <li><a class="store-brand" href="http://localhost/printer/index.php"><i class="fa fa-mobile-phone fa-lg"></i><span class="hidden-sm"> Call us on 0800 123456</span></a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="glyphicon glyphicon-cog"></i><span class="hidden-sm"> Site Settings</span> <span class="caret"></span></a> <ul class="dropdown-menu"> <li class="text-center text-muted bg-primary"><abbr title="Selected Language">L:</abbr> English <abbr title="Selected Currency">C:</abbr> GBP</li> <li class="divider"></li><li><a href="http://localhost/printer/parts_finder.php?filterid=1&currency=USD">U.S. Dollar</a></li><li><a href="http://localhost/printer/parts_finder.php?filterid=1&currency=EUR">Euro</a></li><li><a href="http://localhost/printer/parts_finder.php?filterid=1&currency=GBP">Pounds Sterling</a></li> </ul> </li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#"><i class="glyphicon glyphicon-user"></i><span class="hidden-sm"> My Account</span> <span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="http://localhost/printer/login.php"><i class="glyphicon glyphicon-log-in"></i> Log In</a><li><a href="http://localhost/printer/create_account.php"><i class="glyphicon glyphicon-pencil"></i> Register</a> <li class="divider"></li> <li><a href="http://localhost/printer/account.php">My Account</a></li> <li><a href="http://localhost/printer/account_history.php">My Orders</a></li> <li><a href="http://localhost/printer/address_book.php">My Address Book</a></li> <li><a href="http://localhost/printer/account_password.php">My Password</a></li> </ul> </li> <li class="nav navbar-text"><i class="glyphicon glyphicon-shopping-cart"></i> 0 items</li> </ul> </div> </div> </div> </nav> <div id="bodyWrapper" class="container-fluid"> <div class="row"> <div class="modular-header"> <div id="storeLogo" class="col-sm-8 logo-height"> <a href="http://localhost/printer/index.php"><img src="product_images/store_logo.png" alt="Parts Finder Development" title="Parts Finder Development" width="200" height="50" class="img-responsive" /></a></div> <div class="col-sm-4 logo-height"> <div class="searchbox-margin"><form name="quick_find" action="http://localhost/printer/advanced_search_result.php" method="get" class="form-horizontal"> <div class="input-group"><input type="text" name="keywords" required placeholder="Search" class="form-control" /><span class="input-group-btn"><button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-search"></i></button></span> </div></div></form></div> <div id="catMenu" class="col-sm-12"> <nav class="navbar navbar-default hidden-xs" role="navigation"> <div class="navbar-header"> <button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse"> <span class="sr-only">Toggle Navigation</span> <i class="fa fa-eye"></i> </button> </div> <div class="collapse navbar-collapse" id="bs-navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="http://localhost/printer/index.php"><i class="fa fa-home fa-lg"></i><span class="hidden-sm"> Home</span></a></li> <li><a href="http://localhost/printer/parts_finder.php?filterid=1">Parts Finder</a></li> <li class="dropdown"><ul class="nav navbar-nav"><li class="dropdown"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">Hardware <span class="fa fa-caret-down"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=1"><strong><span"><span class="fa fa-list"></span> Hardware</span><li class="visible-xs divider"></li></strong></a></li><li><a href="http://localhost/printer/index.php?cPath=1_17">CDROM Drives</a></li><li><a href="http://localhost/printer/index.php?cPath=1_4">Graphics Cards</a></li><li><a href="http://localhost/printer/index.php?cPath=1_8">Keyboards</a></li><li><a href="http://localhost/printer/index.php?cPath=1_16">Memory</a></li><li><a href="http://localhost/printer/index.php?cPath=1_9">Mice</a></li><li><a href="http://localhost/printer/index.php?cPath=1_6">Monitors</a></li><li><a href="http://localhost/printer/index.php?cPath=1_5">Printers</a></li><li><a href="http://localhost/printer/index.php?cPath=1_7">Speakers</a></li></ul></li><li class="dropdown"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">Stihl Spare Parts <span class="fa fa-caret-down"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=22"><strong><span"><span class="fa fa-list"></span> Stihl Spare Parts</span><li class="visible-xs divider"></li></strong></a></li><li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">Chainsaws<span class="tsimi"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=22_23"><strong><span"><span class="fa fa-list"></span> Chainsaws</span><li class="visible-xs divider"></li></strong></a></li><li class="dropdown dropdown-submenu"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">MS170, MS170 C<span class="tsimi"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=22_23_24"><strong><span"><span class="fa fa-list"></span> MS170, MS170 C</span><li class="visible-xs divider"></li></strong></a></li><li><a href="http://localhost/printer/index.php?cPath=22_23_24_25">Air Filter & Shroud</a></li></ul></li></ul></li></ul></li><li class="dropdown"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">Software <span class="fa fa-caret-down"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=2"><strong><span"><span class="fa fa-list"></span> Software</span><li class="visible-xs divider"></li></strong></a></li><li><a href="http://localhost/printer/index.php?cPath=2_19">Action</a></li><li><a href="http://localhost/printer/index.php?cPath=2_18">Simulation</a></li><li><a href="http://localhost/printer/index.php?cPath=2_20">Strategy</a></li></ul></li><li class="dropdown"><a href="#" tabindex="-1" class="dropdown-toggle" data-toggle="dropdown">DVD Movies <span class="fa fa-caret-down"></span></a><ul class="dropdown-menu"><li><a href="http://localhost/printer/index.php?cPath=3"><strong><span"><span class="fa fa-list"></span> DVD Movies</span><li class="visible-xs divider"></li></strong></a></li><li><a href="http://localhost/printer/index.php?cPath=3_10">Action</a></li><li><a href="http://localhost/printer/index.php?cPath=3_13">Cartoons</a></li><li><a href="http://localhost/printer/index.php?cPath=3_12">Comedy</a></li><li><a href="http://localhost/printer/index.php?cPath=3_15">Drama</a></li><li><a href="http://localhost/printer/index.php?cPath=3_11">Science Fiction</a></li><li><a href="http://localhost/printer/index.php?cPath=3_14">Thriller</a></li></ul></li><li><a href="http://localhost/printer/index.php?cPath=21">Gadgets</a></li></ul></li> <li><a href="http://localhost/printer/specials.php"><i class="glyphicon glyphicon-fire"></i><span class="hidden-sm"> Special Offers</span></a></li> </ul> </div> </nav> </div></div> <div class="clearfix"></div> <div class="body-sans-header clearfix"> <div id="bodyContent" class="col-md-12 "> <div class="panel panel-default"> <div class="panel-body"> <div> <div class="row"> <div class="col-sm-3"> <div><select name="parts_cat_1" onchange="document.frmveh.parts_cat_1.value=this.value;document.frmveh.submit();" class="form-control"><option value="">Select One</option><option value="3024">Stihl</option><option value="3025">Viking</option></select></div> </div> <div class="col-sm-9">Please use the dropdown boxes to select the make and model of the machine you require parts for.<br><br>To help identify a spare part we use exploaded parts diagrams. A parts diagram is an image of the parts or all of a machine. The image is a line drawing of all of the component parts used to make the machine and the parts are shown in a logical order as per the build of your machine.<br><br>The parts diagram drawing has numbers next to each part and these numbers can be cross referenced into part numbers by using parts table below.</div> </div> </div> </div> </div> <div class="bodyContent"> </div> <form name="frmveh" action="" method="get"> <input type="hidden" name="parts_cat_1" value=""> <input type="hidden" name="filterid" value="1" /> <input type="hidden" name="mode" value="showlist" /> </form> </div> <!-- bodyContent //--> </div> <!-- row --> </div> <footer> <div class="footer"> <div class="container-fluid"> <div class="row"> <div class="col-sm-3"> <div class="footerbox contact"> <h2>How To Contact Us</h2> <address> <strong>Parts Finder Development</strong><br> Address Line 1<br /> Address Line 2<br /> Country<br /> Phone<br> <abbr title="Phone">P:</abbr> 555-1234<br> <abbr title="Email">E:</abbr> tessthepup@gmail.com </address> <ul class="list-unstyled"> <li><a class="btn btn-success btn-sm btn-block" role="button" href="http://localhost/printer/contact_us.php"><i class="glyphicon glyphicon-send"></i> Contact Us</a></li> </ul> </div> </div> <div class="col-sm-3"> <div class="footerbox information"> <h2>Information</h2> <ul class="list-unstyled"> <li><a href="http://localhost/printer/shipping.php">Shipping & Returns</a></li> <li><a href="http://localhost/printer/privacy.php">Privacy & Cookie Policy</a></li> <li><a href="http://localhost/printer/conditions.php">Terms & Conditions</a></li> <li><a href="http://localhost/printer/contact_us.php">Contact Us</a></li> </ul> </div> </div> <div class="col-sm-3"> <div class="footerbox generic-text"> <h2>About Us</h2> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p> </div> </div> </div> </div> </div> <div class="footer-extra"> <div class="container-fluid"> <div class="row"> <div class="col-sm-12 footer-suffix"> <p> <i class="fa fa-mobile fa-lg"></i> <i class="fa fa-tablet fa-lg"></i> <i class="fa fa-laptop fa-lg"></i> <i class="fa fa-desktop fa-lg"></i> </p></div> </div> </div> </div> </footer> <script src="ext/bootstrap/js/bootstrap.min.js"></script> <script src="ext/bootstrap-magnify/js/bootstrap-magnify.min.js"></script> </div> <!-- bodyWrapper //--> </body> </html>
  16. 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
  17. @@grandpaj open the user.css and increase the padding-top, should sort it body { font-family: 'Roboto Condensed', sans-serif;font-size:15px; width: 1200px;margin:0 auto;-overflow-y:scroll;-ms-overflow-style:scrollbar; } @[member=media] (max-width: 1200px) { body { width: 100%;padding-top: 40px !important; }
  18. Hi Guys, Whats is the correct way to apply bootstrap tables into a modified product_listing.php module As it stands I have the following code <?php $listing_query = tep_db_query($listing_split->sql_query); $prod_list_contents = NULL; while ($listing = tep_db_fetch_array($listing_query)) { $prod_list_contents .= '<div>'; $prod_list_contents .= ' <div>'; $prod_list_contents .= '' . $listing['products_id'] . ''; if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } else { $prod_list_contents .= ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>'; } $prod_list_contents .= '' . $listing['mediacat_part_no'] . ''; $prod_list_contents .= '' . $listing['products_mediacat_quantity'] . ''; if (tep_not_null($listing['specials_new_products_price'])) { $prod_list_contents .= '' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ''; } else { $prod_list_contents .= '' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ''; } $prod_list_contents .= '' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-sm') . ''; $prod_list_contents .= ' </div>'; $prod_list_contents .= '</div>'; } echo '<div>' . $prod_list_contents . '</div>'; } else { ?> <div class="alert alert-info"><?php echo TEXT_NO_PRODUCTS; ?></div> <?php } ?> which displays as in the attached image I have studied lots of examples around the interweb but not entirely sure how to apply it. There are 6 colums all squished together in the image Thanks Mark
  19. ok I have managed to rework the divs and now this works for the colums but I can not seem to get the image responsive and it makes the page scroll right on small devices echo '<div class="row">'; echo ' <div class="col-md-6 col-sm-6 col-xs-12">'; echo ' <div class="sp-wrap"><a href="'.tep_href_link(DIR_WS_IMAGES_PARTS . $category_image['categories_image_large']).'">' . tep_image_maps(DIR_WS_IMAGES_PARTS . $category_image['categories_image'], NULL, NULL, 'class="img-responsive"') . '</a></div>'; echo ' </div>'; echo ' <div class="col-md-6 col-sm-6 col-xs-12">'; include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_LIST); echo ' </div>'; echo '</div>';
  20. @bruyndoncx @wHiTeHaT I have now the layout I require for large devices but not sure about the breakpoints for small devices The code I have is echo '<div class="alert alert-info">' . $category_image['category_image_name'] . '</div>'; echo '<div id="parts_container">'; echo ' <div id="image_column">'; echo ' <div class="sp-wrap"><a href="'.tep_href_link(DIR_WS_IMAGES_PARTS . $category_image['categories_image_large']).'">' . tep_image_maps(DIR_WS_IMAGES_PARTS . $category_image['categories_image'], '', '', '', '', 'class="img-responsive"') . '</a></div>'; echo ' </div>'; echo ' <div id="parts_column">'; include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_LIST); echo ' </div>'; echo '</div>'; and the css #parts_container { width: 100%; } #image_column { float: left; width: 50%; } #parts_column { float: right; width: 50%; } As it stands the when viewing on small devices it the 'parts_column' overflows below the image but not in a nice way Mark
  21. @@bruyndoncx reading does help lol Thanks that got it :-
  22. this is how I ended up doing it <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ $listing_split = new splitPageResults($listing_sql, '16', 'pd.mediacat_part_no'); ?> <?php if ($messageStack->size('product_action') > 0) { echo $messageStack->output('product_action'); } ?> <div class="table-responsive"> <table class="table table-border"> <thead> <tr> <th class="col-xs-1">No.</th> <th class="col-xs-3">Part No.</th> <th class="col-xs-3">Description</th> <th class="col-xs-1">Qty</th> <th class="col-xs-2">Price</th> <th class="col-xs-2">Buy Now</th> </tr> </thead> </table> </div> <?php if ($listing_split->number_of_rows > 0) { ?> <?php $listing_query = tep_db_query($listing_split->sql_query); $prod_list_contents = NULL; while ($listing = tep_db_fetch_array($listing_query)) { $prod_list_contents .= '<div class="table-responsive">'; $prod_list_contents .= '<table class="table table-condensed table-striped table-no-border">'; $prod_list_contents .= '<tbody>'; $prod_list_contents .= ' <tr>'; $prod_list_contents .= ' <td class="col-xs-1">' . $listing['products_id'] . '</td>'; $prod_list_contents .= ' <td class="col-xs-3">' . $listing['mediacat_part_no'] . '</td>'; if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td class="col-xs-3"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>'; } else { $prod_list_contents .= ' <td class="col-xs-3"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>'; } $prod_list_contents .= ' <td class="col-xs-1">' . $listing['products_mediacat_quantity'] . '</td>'; if (tep_not_null($listing['specials_new_products_price'])) { $prod_list_contents .= '<td class="col-xs-2">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>'; } else { $prod_list_contents .= '<td class="col-xs-2">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>'; } $prod_list_contents .= '<td class="col-xs-2">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-xs') . '</td>'; $prod_list_contents .= ' </tr>'; $prod_list_contents .= ' </tbody>'; $prod_list_contents .= '</table>'; $prod_list_contents .= '</div>'; } echo '<div>' . $prod_list_contents . '</div>'; } else { ?> <div class="alert alert-info"><?php echo TEXT_NO_PRODUCTS; ?></div> <?php } ?> just need to sort out the niggles with the row header alignment and pretify it for mobile view
  23. @@wHiTeHaT thanks mate, so far so good I now just need a pointer on how to move the column headers outsite of the while loop. Everytime I tried it showed the first row of the data in the table and then the rest outside of the table. <?php /* $Id$ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2010 osCommerce Released under the GNU General Public License */ $listing_split = new splitPageResults($listing_sql, '16', 'pd.mediacat_part_no'); ?> <?php if ($messageStack->size('product_action') > 0) { echo $messageStack->output('product_action'); } ?> <?php if ($listing_split->number_of_rows > 0) { ?> <?php $listing_query = tep_db_query($listing_split->sql_query); $prod_list_contents = NULL; while ($listing = tep_db_fetch_array($listing_query)) { $prod_list_contents .= '<div>'; $prod_list_contents .= ' <div>'; $prod_list_contents .= '<table class="table table-striped table-bordered">'; $prod_list_contents .= ' <thead>'; $prod_list_contents .= ' <tr>'; $prod_list_contents .= ' <th>No.</th>'; $prod_list_contents .= ' <th>Part No.</th>'; $prod_list_contents .= ' <th>Name</th>'; $prod_list_contents .= ' <th>Qty</th>'; $prod_list_contents .= ' <th>Price</th>'; $prod_list_contents .= ' <th>Buy Now</th>'; $prod_list_contents .= ' </tr>'; $prod_list_contents .= ' </thead>'; $prod_list_contents .= '<tbody>'; $prod_list_contents .= ' <tr>'; $prod_list_contents .= ' <td class="col-md-2">' . $listing['products_id'] . '</td>'; $prod_list_contents .= ' <td class="col-md-2">' . $listing['mediacat_part_no'] . '</td>'; if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td class="col-md-2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>'; } else { $prod_list_contents .= ' <td class="col-md-2"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a></td>'; } $prod_list_contents .= ' <td class="col-md-2">' . $listing['products_mediacat_quantity'] . '</td>'; if (tep_not_null($listing['specials_new_products_price'])) { $prod_list_contents .= '<td class="col-md-2">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>'; } else { $prod_list_contents .= '<td class="col-md-2">' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</td>'; } $prod_list_contents .= '<td class="col-md-2">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-sm') . '</td>'; $prod_list_contents .= ' </tr>'; $prod_list_contents .= ' </tbody>'; $prod_list_contents .= '</table>'; $prod_list_contents .= ' </div>'; $prod_list_contents .= '</div>'; } echo '<div>' . $prod_list_contents . '</div>'; } else { ?> <div class="alert alert-info"><?php echo TEXT_NO_PRODUCTS; ?></div> <?php } ?> Also if you spot any other problems please advise. Thanks Mark
  24. check your closing </div> as you maybe missing one
  25. @@drillsar You can use this version as a live shop if you wish and it work ok. Just make sure you keep an eye on the updates on github and update as required.
×