Jump to content



Latest News: (loading..)

* * * * * 3 votes

[Contribtion] Year/Make/Model for OSC v2.3.x


  • Please log in to reply
217 replies to this topic

#1   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 10 February 2011 - 04:18 AM

This is the Official Support Thread for the Year/Make/Model Contribution for osCommerce v2.3.x.  I will monitor this thread and answer any questions I can.  However, I offer FREE support in my spare time so if I don't reply, I don't have any spare time.

Download the new version for 2.3.1 Here

http://addons.oscommerce.com/info/7835


Chris

Edited by Jan Zonjee, 10 February 2011 - 07:32 PM.

:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#2   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 10 February 2011 - 09:33 PM

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

Quote

localhost/catalog/parts_finder.php?filterid=1

and when I try to use the year, make, model the url changes to this

Quote

localhost/catalog/parts_finder.php?Make=Stihl&Model=MS170&filterid=1

is 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

#3   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 11 February 2011 - 12:21 AM

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
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#4   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 06:34 PM

View PostDunWeb, on 11 February 2011 - 12:21 AM, said:

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

#5   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 11 February 2011 - 06:59 PM

Hi Mark,

This code in application_top.php sets the cookies for the search criteria:

//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs
$expire=time()+60*60*24*90;
$where = "";
$YMM_where = "";

if(isset($_GET['Make'])){
setcookie("Make_selected", $_GET['Make'], $expire,'/');
if($_GET['Make'] != 'all')
$Make_selected_var = $_GET['Make'];
}elseif(isset($_COOKIE['Make_selected']) && $_COOKIE['Make_selected'] != 'all')
$Make_selected_var = $_COOKIE['Make_selected'];

if(isset($_GET['Model'])){
setcookie("Model_selected", $_GET['Model'], $expire,'/');
if($_GET['Model'] != 'all')
$Model_selected_var = $_GET['Model'];
}elseif(isset($_COOKIE['Model_selected']) && $_COOKIE['Model_selected'] != 'all')
$Model_selected_var = $_COOKIE['Model_selected'];

if(isset($_GET['Year'])){
setcookie("Year_selected", $_GET['Year'], $expire,'/');
if($_GET['Year'] != 0)
$Year_selected_var = $_GET['Year'];
}elseif(isset($_COOKIE['Year_selected']) && $_COOKIE['Year_selected'] != 0)
$Year_selected_var = $_COOKIE['Year_selected'];


if(isset($Make_selected_var))
$where .= " (products_car_make='".$Make_selected_var."' or products_car_make='') ";

if(isset($Model_selected_var))
$where .= ($where != '' ? ' and ' : '') . " (products_car_model='".$Model_selected_var."' or products_car_model='') ";

if(isset($Year_selected_var))
$where .= ($where != '' ? ' and ' : '') . " ((products_car_year_bof <= '".$Year_selected_var."' and products_car_year_eof >= '".$Year_selected_var."') or (products_car_year_bof=0  and products_car_year_eof=0)) ";


if($where != ''){


$q = tep_db_query("SELECT DISTINCT products_id FROM products_ymm WHERE " . $where);

$ids = '';

if(mysql_num_rows($q) > 0){

while ($r = tep_db_fetch_array($q))
$ids .= ($ids != '' ? ',' : '') . $r['products_id'];
  
}


/*$q = tep_db_query("SELECT products_id FROM " . TABLE_PRODUCTS . " WHERE products_id not in (SELECT DISTINCT products_id FROM products_ymm)  and products_status = 1");

if(mysql_num_rows($q) > 0){

while ($r = tep_db_fetch_array($q))
$ids .= ($ids != '' ? ',' : '') . $r['products_id'];
  
}*/


$YMM_where .= " p.products_id in ($ids) and ";

}
//eof Year_Make_Model Contribution v2.3.x by Dunweb Designs


I would suggest that the Print Toner contribution has similar code that was inserted into the application_top.php as well.  The YMM contribution comes with a 'clear vehicle' button in the column box, this button removes the cookies and resets the site back to listing of all products.  I am not sure if the other contribution does this, but I suspect that is the conflict.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#6   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 07:07 PM

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


#7   cubifil

cubifil
  • Members
  • 4 posts
  • Real Name:cubizolles

Posted 11 February 2011 - 07:15 PM

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 . "'";
	  }
	}


#8   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 07:23 PM

View Postcubifil, on 11 February 2011 - 07:15 PM, said:

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?

#9   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 11 February 2011 - 07:36 PM

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
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#10   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 07:45 PM

View PostDunWeb, on 11 February 2011 - 07:36 PM, said:

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

#11   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 11 February 2011 - 08:05 PM

Ok Mark,

I really didn't look at it that closely but thought it was worth a shot.

So, let me ask.  Do you need to keep the print/toner contribution with the YMM contribution ??  It seems redundant to have have both.  If not, remove one or the other to resolve the conflict.



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#12   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 08:13 PM

View PostDunWeb, on 11 February 2011 - 08:05 PM, said:

Ok Mark,

I really didn't look at it that closely but thought it was worth a shot.

So, let me ask.  Do you need to keep the print/toner contribution with the YMM contribution ??  It seems redundant to have have both.  If not, remove one or the other to resolve the conflict.

Chris

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

#13   DunWeb

DunWeb

    The Censored One

  • Members
  • 12,720 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 11 February 2011 - 08:13 PM

Mark,

Do you think you could PM me the website URL so I can look at it ?



Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile (click here)

#14   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 11 February 2011 - 08:17 PM

View PostDunWeb, on 11 February 2011 - 08:13 PM, said:

Mark,

Do you think you could PM me the website URL so I can look at it ?

Chris

I wish I could but the store is still on localhost.

Mark

#15   PupStar

PupStar
  • Members
  • 559 posts
  • Real Name:Mark
  • Gender:Male

Posted 12 February 2011 - 07:20 PM

ok I have been looking into santizing the url but with no great results.

It really needs to be done when the 'Find' button is pressed.

Has anyone done this sort of thing before?

Thanks

Mark

#16   jasyn

jasyn
  • Members
  • 282 posts
  • Real Name:Jason
  • Gender:Male

Posted 14 February 2011 - 11:29 PM

is there a website running this addon live?

#17   jasyn

jasyn
  • Members
  • 282 posts
  • Real Name:Jason
  • Gender:Male

Posted 15 February 2011 - 12:00 AM

View Postjasyn, on 14 February 2011 - 11:29 PM, said:

is there a website running this addon live?

nevermind i went ahead and installed a new fresh osc and gave it a test run. the script looks clean. possible things you may want to add are:

1. instead of typing every year, make, model for all new products, there is a drop down list of previous year/make/models aleady created so that there no overlaps/typo make & models.
2. the product info pages seem to have an incorrect css coding somewhere. all links are underlined for some reason http://www.tecknologie.net/osc/product_info.php?cPath=1_4&products_id=2.
3. Universal items aren't counted for in the # count for products.

Edited by jasyn, 15 February 2011 - 12:03 AM.


#18   cubifil

cubifil
  • Members
  • 4 posts
  • Real Name:cubizolles

Posted 15 February 2011 - 06:54 AM

hello everybody

you have a solution to exclude a category of filter ?

#19   cubifil

cubifil
  • Members
  • 4 posts
  • Real Name:cubizolles

Posted 15 February 2011 - 10:38 AM

View Postcubifil, on 15 February 2011 - 06:54 AM, said:

hello everybody

you have a solution to exclude 1 category of filter ?


#20   MotoCCnl

MotoCCnl
  • Members
  • 1 posts
  • Real Name:Remco

Posted 16 February 2011 - 08:46 PM

Dear DunWeb,

First of all, thanks for this great module, im using a zencart based shop myself, so i made it work with zencart.

There is just on thing, my shop has 8000+ items, and the module is shown in the left sidebox, so it's loaded before the page is shown.
So if the has much traffic, or the visitor has a slow connection it takes a few seconds extra before they see the page contents.

Is there a way that to delay the script for a few seconds or, even better, to wait until the page is loaded.

I understand there is a function for that in javascript, butt sinds i have no experience with javascript i hoped you could help,
and i think there will be more shop owners who will like that.

Remco