PupStar
-
Posts
957 -
Joined
-
Last visited
-
Days Won
10
Posts posted by PupStar
-
-
Hi Mark,
I think Cubifil is suggesting you change the code to reset the filter after each search.
Give it a try. Make a back up first.
Chris
Oops Sorry :blush:
Ok I have tried it and it did not make any difference.
Regards
Mark
-
excuse me for my english but i' m french
in index.php change this
if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, 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 where 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)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . 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 p2c.categories_id = '" . (int)$current_category_id . "'"; } }
for this
if (isset($HTTP_GET_VARS['manufacturers_id'])) { if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only a specific category $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, 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 where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " 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)$HTTP_GET_VARS['manufacturers_id'] . "'"; } } else { // show the products in a given categorie if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) { // We are asked to show only specific catgeory $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'"; } else { // We show them all $listing_sql = "select " . $select_column_list . " p.products_id, 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, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_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 p2c.categories_id = '" . (int)$current_category_id . "'"; } }
sorry but what are you asking?
-
Hi Chris,
No there is no code in application top as it is all contained in the one file, this is what I have:
<?php /* Printer Ink & Toner Filter V1.7 for Oscommerce v2.2 RC2a September 2010 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'); require(DIR_WS_MODULES . FILENAME_IMAGE_MAPS); if(isset($_REQUEST['filterid'])&&($_REQUEST['filterid']!='')) { $filterid = $_REQUEST['filterid']; $filterqueery = tep_db_query("select * from ".TABLE_PRINTER_CATEGORY." where parent_id = '0' AND printer_category_id = '".$filterid."'"); if(mysql_num_rows($filterqueery)>0) { $showfilter = true; } } require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_FILTER_PRINTER); $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_INKTONERFINDER)); require(DIR_WS_INCLUDES . 'template_top.php'); ?> <div style="clear: both; padding:5px;"></div> <div class="contentContainer"> <div class="ui-widget-header ui-corner-top infoBoxHeading"><?php echo TABLE_HEADING_PRODUCTS; ?> </div> <div class="contentContainer"> <div class="ui-widget ui-widget-content-white ui-corner-bottom contentText" style="padding:10px; background-color:#fdfdfd;"> <?php if($showfilter){?> <div class="contentContainer"> <div class="ui-widget ui-widget-content ui-corner-all contentText" style="padding: 10px; background: #f4f4f4 url(images/main-bg.png); background-repeat: repeat-xy; font-style: italic;"> <div class="contentText"><?php echo TEXT_PARTS_FINDER_DESCRIPTION;?> </div> </div> </div> <div> <?php getprintercatoptions($filterid); ?> </div> <div class="bodyContent"> <?php $printerid = 0; if(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='showlist')) { $printerid= $_REQUEST['part_cat_'.$filterid]; } elseif(isset($_REQUEST['mode'])&&($_REQUEST['mode']=='searchlist')) { $vehidrow = @mysql_fetch_array(mysql_query("SELECT printer_category_id, categories_image FROM ".TABLE_PRINTER_CATEGORY." where category_name = '".$_REQUEST['keywords']."'")); if($vehidrow['printer_category_id']!='') { $printerid= $vehidrow['printer_category_id']; $printerid= $vehidrow['categories_image']; } } $define_list = array('PRODUCT_LIST_MEDIACAT_PART_NO' => PRODUCT_LIST_MEDIACAT_PART_NO, 'PRODUCT_LIST_MEDIACAT_QUANTITY' => PRODUCT_LIST_MEDIACAT_QUANTITY, 'PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL, 'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME, 'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER, 'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE, 'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY, 'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT, 'PRODUCT_LIST_BUY_NOW' => 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 'PRODUCT_LIST_MEDIACAT_PART_NO': $select_column_list .= 'pd.mediacat_part_no, '; break; case 'PRODUCT_LIST_MEDIACAT_QUANTITY': $select_column_list .= 'p.products_mediacat_quantity, '; break; case 'PRODUCT_LIST_MODEL': $select_column_list .= 'p.products_model, '; break; case 'PRODUCT_LIST_NAME': $select_column_list .= 'pd.products_name, '; break; case 'PRODUCT_LIST_MANUFACTURER': $select_column_list .= 'm.manufacturers_name, '; break; case 'PRODUCT_LIST_QUANTITY': $select_column_list .= 'p.products_quantity, '; break; case 'PRODUCT_LIST_IMAGE': $select_column_list .= 'p.products_image, '; break; case '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, p.manufacturers_id, p.products_price, pd.mediacat_part_no, 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"; } ?> <?php $catimage_query = tep_db_query("select categories_image, category_image_name, category_imagemap_name FROM ".TABLE_PRINTER_CATEGORY." WHERE printer_category_id = '".$printerid."'"); while ($category_image = tep_db_fetch_array($catimage_query)) { if($productids!='') { $imagemap = $category_image['category_imagemap_name']; echo '<div style="clear: both; padding:5px;"></div><div class="contentContainer" style="font-weight: bold;">' . $category_image['category_image_name'] . '</div>'; echo '<div class="ui-widget ui-widget-content-white ui-corner-all contentText" style="padding-left: 80px;">' . tep_image_maps(DIR_WS_IMAGES . $category_image['categories_image'], '', $imagemap) .'</div>'; echo '<div class="contentContainer">'; echo ' <div style="clear: both; padding:5px;"></div><div class="ui-widget ui-widget-content ui-corner-all contentText" style="padding: 10px; background: #f4f4f4 url(images/main-bg.png); background-repeat: repeat-xy; font-style: italic;">'; echo ' <div class="contentText">' . TEXT_PARTS_FINDER_INFORMATION . ''; echo ' </div>'; echo "<a href=\"javascript:void(0);\" onclick=\"NewWindow('popup_order_trouble.php', 'toolbar=no,directories=no,location=no,status=yes,menubar=no,resizable=no,scrollbars=yes,width=300,height=300'); return false\"><b><u>Having trouble ordering, click here for help!</b></u></a>"; echo ' </div>'; echo '</div>'; echo '<div style="clear: both; padding:3px;"></div>'; include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_LIST); } } } ?> <?php }?> </div></div> <?php function getprintercatoptions($printer_category_id="",$curprintercatid="") { $fieldid = $printer_category_id; if(isset($_REQUEST['part_cat_'.$printer_category_id])&&($_REQUEST['part_cat_'.$printer_category_id]!='')) { $printer_category_id = $_REQUEST['part_cat_'.$printer_category_id]; $str = getprintercatpath($printer_category_id,""); $chkbottomROW = mysql_fetch_array(mysql_query("SELECT count(printer_category_id) FROM " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$printer_category_id."'")); 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="") { ?> <?php $i=0; $cntvarr = count($catarr); foreach($catarr as $val) { $veh_cat_array = array(array('id' => '', 'text' => 'Please Select')); $printers_query = tep_db_query("select * from " . TABLE_PRINTER_CATEGORY . " where parent_id = '".$val."' order by category_name"); if(mysql_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']); } ?> <?php if($cntvarr==$i+1) { $selval = $printer_category_id; } else { $selval = $catarr[$i+1]; } ?> <div class="parts_finder" align="left" valign="top"> <?php echo tep_draw_pull_down_menu('part_cat_'.$val, $veh_cat_array, $selval, 'onchange="document.frmveh.part_cat_'.$fieldid.'.value=this.value;document.frmveh.submit();"'); ?> </div> <?php $i++; } } ?> <?php } 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></div> <div class="ui-widget ui-corner-all"> <form name="frmveh" action="" method="get"> <input type="hidden" name="part_cat_<?php echo $filterid;?>" value="<?php echo $_REQUEST['part_cat_1'];?>"> <input type="hidden" name="filterid" value="<?php echo $filterid;?>" /> <input type="hidden" name="mode" value="showlist" /> </form> </div> <?php require(DIR_WS_INCLUDES . 'template_bottom.php'); require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
-
Hi Mark,
Although I am not familiar with the ink/toner contribution I would assume it uses the same filter system as YMM. Are you planning to use both contributions on your website ? If so, you may need to change the code inserted into general.php to create a unique identifier for one or the other contribution to avoid a conflict.
Chris
which bit of code in particular for YMM do you mean???
Thanks for the reply
Mark
-
Hi Chris,
A big thumbs up from me :thumbsup:
After a few cosmetic changes it is now working great woohoo :D
However I have one problem, I am also using a the 'Printer Ink & Toner' contribution which I have modded to be a parts finder module.
The issue is that when I am on the parts finder page I have this is the url
localhost/catalog/parts_finder.php?filterid=1and when I try to use the year, make, model the url changes to this
localhost/catalog/parts_finder.php?Make=Stihl&Model=MS170&filterid=1is there anyway you know of that I can clear the url or some logic if that I am on that page then jump back to index.php and then perform the search???
Thanks
Mark
-
I was told Easy Populate 2.76i-MS2 has an option I can turn on to load title & tags at the same time I upload new products to the store.
How do you enable this option...Is this done within the EP file?
As long as you are using the 'Header Tags' by 'Jack mcs' then change this line in admin/easypopulate.php
// Header Tags Controller Support v2.0 define ('EP_HTC_SUPPORT', false); // default is false
Change false to true
Although if your using 2.3.1 then I am not sure if it will work as I have not tried it yet.
Regards
Mark
-
It should be like this
' ' . tep_information_show_category(1) . '' .
Regards
Mark
-
you need to change the short tags ie '<?' to '<?php'
without the quotes :thumbsup:
-
Hi
Thanks for your reply.
Im not sure which one it would be on to be honest. Its coming up on my cpanel as used 500mb disk space. Im looking to upload a couple of thousand images.
Regards
drop a support ticket to your host and ask them to upgrade your account, you may well have to pay more for the extra.
-
Hi
I am fairly new to these forums and was wandering if anyone could tell me if it was possible to accumulate extra disk space, and if so how would I do it.
Any feedback would be much appreciated.
Regards
If you mean on your hosting account then you need to contact your web host.
-
Iankil,
Great contrib. I use it on my live store (osc RC2.2a) but am upgrading my store to 2.3.1 as soon as I get enough of the contributions I'm currently using working in 2.3.1 (Like Wishlist).
I've installed this on my test site, and added
include(DIR_WS_BOXES . 'articles.php'); //ArticlesManager v1.57_6 include(DIR_WS_BOXES . 'header_tags_seo.php'); //Header Tags SEO v3.2.5 include(DIR_WS_BOXES . 'sitemonitor.php'); //Sitemonitor v2.8
into the header.php file just below
include(DIR_WS_BOXES . 'configuration.php'); include(DIR_WS_BOXES . 'catalog.php'); include(DIR_WS_BOXES . 'modules.php'); include(DIR_WS_BOXES . 'customers.php'); include(DIR_WS_BOXES . 'taxes.php'); include(DIR_WS_BOXES . 'localization.php'); include(DIR_WS_BOXES . 'reports.php'); include(DIR_WS_BOXES . 'tools.php');
Now, on my test site the header drop menu's appear as thus:
Is there a way to make it when the header menu 'wraps' that the second line appears a bit lower? So that it appears more like this:
Naloomi
go to admin>tools>mindsparx admin and increase the width of the template.
-
Hi Guys,
I am really tearing my hair out now with this. I have it working in the admin ok its the catalog side that is causing the problem.
Unfortuantely I do not have a link to show you as the site is on localhost on my laptop at the minute.
Basically what is happening is that when I select the make and the model and then click 'find' the page just loops back to the index.php page, the url does change however to:
http://localhost/catalog/index.php?Make=Ford&Model=Focus
The code below is for the info box and the function file (although one member suggested splitting the function and another said it was unnessary, not sure which one is correct so left it the way it is for now)
If anyone could spare the time to glance over the code and let me know what they think :blush:
Make/Model Infobox in catalog/includes/modules/boxes
<?php class bm_make_model { var $code = 'bm_make_model'; var $group = 'boxes'; var $title; var $description; var $sort_order; var $enabled = false; function bm_make_model() { $this->title = MODULE_BOXES_MAKE_MODEL_TITLE; $this->description = MODULE_BOXES_MAKE_MODEL_DESCRIPTION; if ( defined('MODULE_BOXES_MAKE_MODEL_STATUS') ) { $this->sort_order = MODULE_BOXES_MAKE_MODEL_SORT_ORDER; $this->enabled = (MODULE_BOXES_MAKE_MODEL_STATUS == 'True'); $this->group = ((MODULE_BOXES_MAKE_MODEL_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right'); } } function execute() { global $oscTemplate; include_once(DIR_WS_FUNCTIONS . FILENAME_MAKE_MODEL_FUNCTIONS); $data = '<div class="ui-widget infoBoxContainer ">' . ' <div class="ui-widget-header ui-corner-top infoBoxHeading">' . MODULE_BOXES_MAKE_MODEL_BOX_TITLE . '</div>' . ' <div class="ui-widget-content ui-corner-bottom infoBoxContents" style="text-align: center;"> ' . ' ' . MODULE_BOXES_MAKE_MODEL_BOX_DESCRIPTION . ' '. ' ' . $javascript . ' ' . ' ' . tep_draw_form('make_model_year', $action, 'get', '', false) . ' ' . ' ' . tep_draw_pull_down_menu('Make', $Make_array, (isset($Make_selected_var) ? $Make_selected_var : ''), 'onchange="pop_model();" style="width: 85%"') .' ' . ' <span id="model_select">' . tep_draw_pull_down_menu('Model', $Model_array, (isset($Model_selected_var) ? $Model_selected_var : ''), 'onchange="pop_year();" style="width: 85%"') .'</span>' . ' ' . $hidden_get_variables . tep_hide_session_id() . '<br>' . ' ' . tep_draw_button(IMAGE_BUTTON_FIND, 'key', null, 'primary') . '<br>' . ' <a href="'.$link.'">Clear Selection</a>' . ' </form>' . ' </div>' . '</div>'; $oscTemplate->addBlock($data, $this->group); } function isEnabled() { return $this->enabled; } function check() { return defined('MODULE_BOXES_MAKE_MODEL_STATUS'); } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Make/Model Module', 'MODULE_BOXES_MAKE_MODEL_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_MAKE_MODEL_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_MAKE_MODEL_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_BOXES_MAKE_MODEL_STATUS', 'MODULE_BOXES_MAKE_MODEL_CONTENT_PLACEMENT', 'MODULE_BOXES_MAKE_MODEL_SORT_ORDER'); } } ?>
Make/Model Functions in catalog/includes/functions
<?php $Make_Model_Year_query = tep_db_query("select distinct products_car_make, products_car_model, products_car_year_bof, products_car_year_eof from products_ymm where products_car_make != '' and products_car_model != '' and products_car_year_bof !=0 and products_car_year_eof != 0 order by products_car_make, products_car_model, products_car_year_bof, products_car_year_eof"); if ($number_of_rows = tep_db_num_rows($Make_Model_Year_query)) { // Display a drop-down $Make_array[] = array('id' => 'all', 'text' => 'Choose Brand'); $Model_array[] = array('id' => 'all', 'text' => 'Choose Model'); $Year_array[] = array('id' => 0, 'text' => 'Choose Year'); $javascript = '<script language="javascript" type="text/javascript"> var a = new Array(); var b = new Array(); var c = new Array();'; $y = array(); $M_a = array(); $products_car_make_old = ''; $products_car_model_old = ''; while ($Makes = tep_db_fetch_array($Make_Model_Year_query)) { if (!isset($M_a [$Makes['products_car_make']])) $Make_array[] = array('id' => $Makes['products_car_make'], 'text' => $Makes['products_car_make']); if (!isset($M_a [$Makes['products_car_make']][$Makes['products_car_model']]) && count($y) > 0){ $M_a [$products_car_make_old][$products_car_model_old]=$y; $y = array(); } if ($Makes['products_car_year_bof'] != 0 && $Makes['products_car_year_eof'] != 0){ if ($Makes['products_car_year_bof'] == $Makes['products_car_year_eof']){ $y [$Makes['products_car_year_bof']] = 1; } elseif ($Makes['products_car_year_bof'] < $Makes['products_car_year_eof']){ while ($Makes['products_car_year_bof'] <= $Makes['products_car_year_eof']){ $y [$Makes['products_car_year_bof']] = 1; $Makes['products_car_year_bof']++; } } } $products_car_make_old = $Makes['products_car_make']; $products_car_model_old = $Makes['products_car_model']; $M_a [$Makes['products_car_make']][$Makes['products_car_model']] = array(); } $M_a [$products_car_make_old][$products_car_model_old]=$y; $i = 0; foreach ($M_a as $k =>$v){ $javascript .= 'a['.$i.']="'.$k.'";b['.$i.']=new Array('; $ii = 0; $s = ''; foreach ($M_a[$k] as $kk =>$vv){ $javascript .= ($ii != 0 ? ',' : '').'"'.$kk.'"'; $ss = ''; $iii = 0; foreach ($M_a[$k][$kk] as $kkk => $vvv){ $ss .= ($iii != 0 ? ',' : '').$kkk; $iii++; } if ($iii == 1) $ss = '"'.$ss.'"'; $s .= 'c['.$i.']['.$ii.']=new Array('.$ss.');'; $ii++; } $javascript .= ');c['.$i.']=new Array();'.$s; $i++; } $javascript .= ' function pop_model(){ var o ="<select name=\"Model\" onChange=\"pop_year();\" style=\"width: 100%\"><option value=\"all\">Choose Model</option>"; var sv = document.make_model_year.Make.value; if(sv != "all"){ var v = a.length; while(v--) if(sv == a[v]) break; for(var i = 0; i < b[v].length; i++) o+="<option value=\""+b[v][i]+"\">"+b[v][i]+"</option>"; } o+="</select>"; document.getElementById("model_select").innerHTML= o; document.getElementById("year_select").innerHTML= "<select name=\"Year\" style=\"width: 100%\"><option value=\"0\">Choose Year</option></select>"; } function pop_year(){ var o ="<select name=\"Year\" style=\"width: 100%\" onChange=\"document.make_model_year.submit();\"><option value=\"0\">Choose Year</option>"; var sv = document.make_model_year.Make.value; if(sv != "all"){ var v = a.length; while(v--) if(sv == a[v]) break; var sv2 = document.make_model_year.Model.value; if(sv2 != "all"){ var v2 = b[v].length; while(v2--) if(sv2 == b[v][v2]) break; for(var i = 0; i < c[v][v2].length; i++) o+="<option value=\""+c[v][v2][i]+"\">"+c[v][v2][i]+"</option>"; } } o+="</select>"; document.getElementById("year_select").innerHTML= o; } </script>'; if (isset($Make_selected_var) && isset($M_a[$Make_selected_var])){ foreach ($M_a[$Make_selected_var] as $k => $v) $Model_array[] = array('id' => $k, 'text' => $k);} if (isset($Make_selected_var) && isset($Model_selected_var) && isset($M_a[$Make_selected_var][$Model_selected_var])) foreach ($M_a[$Make_selected_var][$Model_selected_var] as $k => $v) $Year_array[] = array('id' => $k, 'text' => $k); $script = basename($_SERVER['SCRIPT_NAME']); if ($script == 'index.php' && (!isset($cPath) || $cPath == '')){ if (defined('FILENAME_ALLPRODS_SEO') && ALL_PRODUCTS_SEO == 'true'){ $script = FILENAME_ALLPRODS_SEO ; } elseif (defined('ALL_PRODUCTS') && ALL_PRODUCTS == 'true'){ $script = FILENAME_ALLPRODS ; } } $hidden_get_variables = ''; $keys = Array('Year','Make','Model',tep_session_name(),'x','y'); if ($script == 'product_info.php'){ if(isset($cPath) || $cPath != ''){ $_GET['cPath'] = $cPath; $link = 'index.php?cPath='.$cPath.'&Make=all&Model=all&Year=0'; } else { $link = 'index.php?Make=all&Model=all&Year=0'; } $action = 'index.php'; $keys [] = 'products_id'; } elseif (SEO_ENABLED == 'true' && basename($PHP_SELF) != FILENAME_ADVANCED_SEARCH_RESULT){ $action = tep_href_link($script, tep_get_all_get_params(array('Make','Model','Year')), 'NONSSL', false); $link = tep_href_link($script, tep_get_all_get_params(array('Make','Model','Year')).'Make=all&Model=all&Year=0', 'NONSSL', false); $keys [] = 'cPath'; $keys [] = 'products_id'; $keys [] = 'manufacturers_id'; } else { $action = $script; $link = $script.'?'.tep_get_all_get_params(array('Make','Model','Year')).'Make=all&Model=all&Year=0'; } reset($_GET); while (list($key, $value) = each($_GET)) { if (!in_array($key,$keys)) $hidden_get_variables .= tep_draw_hidden_field($key, $value); } } ?>
-
That error is usually caused by something in the .htaccess file. I don't know exactly what part your server is having a problem with. As a first-approximation guess, try commenting out the last 4 lines and see what happens.
Regards
Jim
Thank you Jim that worked.
-
Hi Jim,
I have installed this contribution into 2.3.1 and it works (with a couple of glitches still to work out)
Now the problem I am having is similar to the above poster with this error:
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
I have checked everything. The file is in the correct location, size and also the link is correct
Any ideas???
Thanks
Mark
-
Hi Toth,
One major problem I have come across is that when I try and disable say the products description in the module by changing the config value to 0 I get this error on the product info page.
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit 0, 12' at line 1select p.products_image, p.products_model,pd.products_description, pd.products_name, p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master like '% 1 %' and p.products_status = '1' and pd.language_id = '1' order by limit 0, 12
[TEP STOP]
Any ideas
Mark
-
Hi Guys,
I am in the process of installing Master Products into 2.3.1 but I receive this error on admin/categories.php
Any clues as to why this error is happening?
Thanks
Mark
ok I have it working now (I think). I went back to basics and used the contribs admin/categories.php and compared and merged my categories.php
Mark
-
Hi Guys,
I am in the process of installing Master Products into 2.3.1 but I receive this error on admin/categories.php
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\wamp\www\catalog\admin\includes\functions\database.php on line 450 -
Resource id #73
[TEP STOP]
Any clues as to why this error is happening?
Thanks
Mark
-
forget it I have it sorted. It was because I had no description entered into the test product! >_<
Hi,
I have installed the above contribution on 2.3.1 and it works to a degree. The admin panel is working correctly and inserting the products_id into the star_product table.
However the catalog side is not displaying the product, just an empty box with no image, no price etc.
Would someone take a look for me and see if they can see what I am missing?
<?php function tep_star_product_with_attributes($products_id) { $attributes_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "'"); $attributes = tep_db_fetch_array($attributes_query); if ($attributes['count'] > 0) { return true; } else { return false; } } $star_products_query = tep_db_query("select substring(pd.products_description, 1, 100) as products_description, p.products_id, p.products_image, p.manufacturers_id, p.products_price, 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, p.products_tax_class_id, sp.product_id from (" . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_STAR_PRODUCT . " sp) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_status = '1' and pd.products_description != '' and p.products_id=sp.product_id and pd.language_id = '" . $languages_id . "'"); $star_products = tep_db_fetch_array($star_products_query); $star_products['products_name'] = tep_get_products_name($star_products['products_id']); $evita_cortar_palabras = explode( ' ', $star_products["products_description"] ); array_pop( $evita_cortar_palabras ); $star_products["products_description"] = implode( ' ', $evita_cortar_palabras ); $star_products_price = $star_products; if (tep_not_null($star_products_price['specials_new_products_price'])) { $new_price = '<span class="starPrice">' . $currencies->display_price($star_products_price['specials_new_products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])) . '</span><br>'; $new_price .= '<span style="color:#ffffff;font-size:12px; font-weight:normal;"><s>' . $currencies->display_price($star_products_price['products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])) . '</s></span>'; } else { $new_price = '<span class="starPrice">' . $currencies->display_price($star_products_price['products_price'], tep_get_tax_rate($star_products_price['products_tax_class_id'])). '</span>'; } if (!tep_star_product_with_attributes($star_products['products_id'])) { $star_products["0"] = array('align' => 'left', 'params' => 'width="100%" valign="top" padding="0"', 'text' => ' <table class="box_outline3" width="99%" border="0" cellpadding="0" cellspacing="0" > <tr> <td width="191" rowspan="3" align="right" valign="top" background="images/star_img.gif"><table width="191" border="0" cellpadding="0"> <tr> <td width="30" align="left" valign="top"> <div style="padding-left:7px; padding-top:15px; " align="left" >'.$new_price . '</div></td> <td height="115" align="right" valign="middle"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td> </tr> </table> </td> <td height="3" align="right" class="starTitle"> </td> </tr> <tr> <td align="left" valign="top"><div style="padding-left:20px;"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '"><span class="starName" >' . $star_products['products_name'] . '</span></a><br /> <span class="starTitle" >'.STAR_TITLE.'</span><br /> <span class="starProdDesc" > <div style="padding-right:15px;" >'. strip_tags($star_products["products_description"]) . '...</div></span></td> </tr> </table>'); $star_products_output = array_slice($star_products, sizeof($star_products)-1); new contentBox1($star_products_output); } else { $star_products["0"] = array('align' => 'center', 'params' => 'width="100%" valign="top"', 'text' => ' <table class="box_outline3" width="99%" border="0" cellpadding="0" cellspacing="0" > <tr> <td width="191" rowspan="3" align="right" valign="top" background="images/star_img.gif"><table width="191" border="0" cellpadding="0"> <tr> <td width="30" align="left" valign="top"> <div style="padding-left:7px; padding-top:15px; " align="left" >'.$new_price . '</div></td> <td height="115" align="right" valign="middle"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '">' . tep_image(DIR_WS_IMAGES . $star_products['products_image'], $star_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td> </tr> </table> </td> <td height="3" align="right" class="starTitle"> </td> </tr> <tr> <td align="left" valign="top"><div style="padding-left:20px;"> <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $star_products["products_id"]). '"><span class="starName" >' . $star_products['products_name'] . '</span></a><br /> <span class="starTitle" >'.STAR_TITLE.'</span><br /> <span class="starProdDesc" > <div style="padding-right:15px;" > '. strip_tags($star_products["products_description"]) . '...</div></span></td> </tr> </table>'); $star_products_output = array_slice($star_products, sizeof($star_products)-1); new contentBox1($star_products); } ?>
Thanks
Mark
-
Thanks ;) Btw i ran a few famous sites threw the validator just for fun and Amazone.com´s mainpage has 415 Errors, 108 warning(s) , Ebay has 485 Errors, 23 warning(s) And this thread has 45 Errors, 5 warning(s) :rolleyes:
ha ha nice one! :-"
-
Hello
I use the famous pure css menu for this addon and many of thouse errors comes from that, i dont care about validating the admin main page since it works great, if you want a cleaner version you can help me to clean it :thumbsup:
/Janne
Hi Janne,
Mindsparx Admin rocks!
I agree its totally pointless to validate the code as it should be locked tight so no one including the search engines can see it.
Keep up the good work :thumbsup:
Mark
-
Looking Good Janne! :thumbsup:
-
ok sussed it out, I changed
$listing_sql = "select " . $select_column_list . " p.products_id, 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, " . 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."')";
to
$listing_sql = "select distinct " . $select_column_list . " p.products_id, 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, " . 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."')";
All I added was 'distinct'
Regards
PS
-
I think I may have found another little issue.
I am testing with 2 products that I have linked to each other, the issue is that that both products show twice when selecting the top level category (see screenshot below)
Anyone know a work around for this?
Thanks
-
Hi Guys,
I am porting this contribution over to the new 2.3 and I have an admin error that is annoying me
which is this line
if ( eregi("(insert|update|setflag)", $action) ) include_once('includes/reset_seo_cache.php');
now this is because eregi is gone in php 5.3
Any ideas on what to replace it with???
Thanks
PS
ok I sorted it by changing it to preg_match
[Contribtion] Year/Make/Model for OSC v2.3.x
in General Add-Ons Support
Posted
I really do need to keep both as the print/toner contrib has been highly modded and is now a spare parts finder with image maps etc.
Thanks
Mark