Jump to content



Photo
* * * * * 5 votes

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


  • Please log in to reply
266 replies to this topic

#41   kenkja

kenkja
  • Members
  • 251 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 12 March 2011 - 17:16

Hello have fixed the above

thanks

Ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags

#42   kenkja

kenkja
  • Members
  • 251 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 12 March 2011 - 19:47

Hello All

Me again

I'm now working on making the add-on work in other languages. I've dealt with adding the bm_year_make_model.php to the includes/languages/"Country Language"/Modules/boxes/ folder and thus changed the title of the YMM box as it appears on index.php

But the first line on each drop down list is still in English. As far as I can work out these titles are given by the includes/modules/boxes/bm_year_make_model.php file in lines 30,31 & 32, as below

$Make_array[] = array('id' => 'all', 'text' => 'Choose Vehicle');
$Model_array[] = array('id' => 'all', 'text' => 'Choose Model');
$Year_array[] = array('id' => 0, 'text' => 'Choose Year');

If I require two languages, say english and german, should I replace these with say

$Make_array[] = array('id' => 'Whatever id represents English', 'text' => 'Choose Vehicle' 'id' => "Whatever id represent German', 'text' => 'German text');
etc, etc

thanks

ken
Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags

#43   kenkja

kenkja
  • Members
  • 251 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 14 March 2011 - 09:03

Regarding last post, it would be great to have the first lines of the created arrays language specific, but as it is reasonable obvious what should be done even if you don't speak/read english, its not a big deal.

More concerning is I don't think I have the install correct as I have 2 issues which I didn't expect.

1. Unless there is at least 1 product with YMM attributes the whole index.php page looses its formatting quite dramatically. The centre section (which contains the user greeting) disappears, both left & right _column(s) change width, the "OS Commerce" logo become left justified and the YMM box has no title.

Clearly the obvious answer is to keep a product with YMM attributes, but is this normal ??

2. Within Admin create/edit a product 2 lines of the coding appear as text between the page title and the product status lines -

Page Title - New Product in "Clothing =>Shirts"

Text Code - //bof Year_Make_Model Contribution V2.3.x by Dunweb Designs
Text Code - //eof Year_Make_Model Contribution V2.3.x by Dunweb Designs
Then - Product Status In Stock/Out of stock line

Again as these lines are only text, they don't really matter, but are something I didn't expect.

I've doubled checked the files affected by the install with the readme.txt file and copied all of them into a spreadsheet along with all of those from the "Drop on Top Files" folder, then asked the spreadsheet to compare each line. Aside from some changes in includes/application_top.php as required by the Secuirty Pro & Ip Trap contributions and some colour changes in stylesheet.css, all of my files appear identical to the "Drop on Top Files" with the exception of

Includes/application_top.php

My Code - Define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3');
Drop on Top - Define('PROJECT_VERSION', 'osCommerce Online Merchant v2.3.1');

Include/Functions/general.php

Instruction 8b of the readme.txt requires the following code to be added before the last ?> the two lines in Red bold type are not in the "Drop on Top Files" version


//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs
function YMM_get_categories_where($id,$where){
global $languages_id;

$cq = tep_db_query("SELECT c.categories_id, c.parent_id FROM " . TABLE_CATEGORIES . " c," . TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id = cd.categories_id AND cd.language_id = '" . (int)$languages_id . "'");

$inc_cat = array();
while ($r = tep_db_fetch_array($cq))
$inc_cat[] = array ('id' => $r['categories_id'],'parent' => $r['parent_id']);

$cat_info = array();
for ($i=0; $i < sizeof($inc_cat); $i++)
$cat_info[$inc_cat[$i]['id']] = array ('parent'=> $inc_cat[$i]['parent'],'path' => array($inc_cat[$i]['id']));

for ($i=0; $i < sizeof($inc_cat); $i++) {
$cat_id = $inc_cat[$i]['id'];
while ($cat_info[$cat_id]['parent'] != 0){
$cat_info[$inc_cat[$i]['id']]['path'] [] = $cat_info[$cat_id]['parent'];
if($cat_info[$cat_id]['parent'] == $id)
$cat_info[$inc_cat[$i]['id']]['ind'] = count($cat_info[$inc_cat[$i]['id']]['path']) - 2;
$cat_id = $cat_info[$cat_id]['parent'];
}
$cat_info[$inc_cat[$i]['id']]['path'] [] = 0;
if($cat_info[$cat_id]['parent'] == $id)
$cat_info[$inc_cat[$i]['id']]['ind'] = count($cat_info[$inc_cat[$i]['id']]['path']) - 2;
}

$ids = '';
if(trim($where) != 'p.products_id in () and'){
for ($i=0; $i < sizeof($inc_cat); $i++) {
if(isset($cat_info[$inc_cat[$i]['id']]['ind'])){
$q = tep_db_query("select
c.categories_id
FROM
" . TABLE_PRODUCTS . " p,
" . TABLE_PRODUCTS_TO_CATEGORIES . " pc,
" . TABLE_CATEGORIES . " c,
" . TABLE_CATEGORIES_DESCRIPTION . " cd
WHERE $where
p.products_id = pc.products_id AND c.categories_id = pc.categories_id AND
p.products_status = '1' AND
c.categories_id = ".$cat_info[$inc_cat[$i]['id']]['path'][0]." AND
c.categories_id = cd.categories_id AND
cd.language_id = '" . (int)$languages_id . "' LIMIT 1");
if(tep_db_num_rows($q) == 1)
$ids .= ($ids != '' ? ',' : '') . $cat_info[$inc_cat[$i]['id']]['path'][$cat_info[$inc_cat[$i]['id']]['ind']];
}
}

return ($ids != '' ? ' c.categories_id in ('.$ids.') and ' : '');
}

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

Also the "Drop on top files" folder includes categories.php with the Admin/Includes/Languages directory, however in my install this is in admin/includes/languages/english

ken





Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags

#44   kenkja

kenkja
  • Members
  • 251 posts
  • Real Name:Ken Johnson
  • Gender:Male
  • Location:Uk, Yorkshire

Posted 14 March 2011 - 14:56

I'm not sure why, but removing the //bof .... & //eof... from code copied into admin/catgories.php (2b in readme.txt) seems to have corrected the admin.

ken

Edited by kenkja, 14 March 2011 - 14:56.

Os-commerce v2.3.3
Security Pro v11
Site Monitor
IP Trap
htaccess Protection
Bad Behaviour Block
Year Make Model
Document Manager
X Sell
Star Product
Modular Front Page
Modular Header Tags

#45   Anasazy

Anasazy
  • Members
  • 2 posts
  • Real Name:Веселин Жечев

Posted 15 March 2011 - 07:41

Hello this is a very usefull module.
Can I ask to help me to modify this module to make permanent filtering, infact when a custemer select his make, model, year to be showno only categories with contragents exactky for his search puted in their caegories for example

you want to look parts for Fiat, Tipo 1.6, 1993, Bumpers, front bumpers

with YMM you choose Fiat, tipo 1.6, 1993 and form categories you choose Bumpers and sub category bumpers, but at that moment with YMM i can sort only in home category cant search in sub categories can you help me to make it little better and can we add more fields to YMM like Modification?
Thanks with best regrads
V.Zhechev
P.S. excuse me for my English

#46   cubifil

cubifil
  • Members
  • 4 posts
  • Real Name:cubizolles

Posted 16 March 2011 - 20:00

small amelioration in file language/index.php
define('TEXT_NO_PRODUCTS', '<h3> No products in this category for your &nbsp;' .  $Make_selected_var  . '&nbsp;' . $Model_selected_var . '

! </h3><br/>To see all the products in this category, <br/> please click <a href="'.tep_href_link(basename($_SERVER['SCRIPT_NAME']), tep_get_all_get_params(array('Make','Model','Year')).'Make=all&Model=all&Year=0', 'NONSSL', false).'"> <font color="#ff0000"><b>See all cancel and atricles</b></font></a> .');

exemple:My link

#47   silverkorn

silverkorn
  • Members
  • 3 posts
  • Real Name:Keith Woodruff

Posted 29 March 2011 - 02:01

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:
2. the product info pages seem to have an incorrect css coding somewhere. all links are underlined for some reason


i found the error in the code that has caused the underline error, there is a missing </u> in the \Drop On Top Files\product_info.php

Before:
<li><u><?php echo TEXT_PRODUCTS_CAR_MODEL; ?></li>
After:
<li><u><?php echo TEXT_PRODUCTS_CAR_MODEL; ?></u></li>

More concerning is I don't think I have the install correct as I have 2 issues which I didn't expect.

1. Unless there is at least 1 product with YMM attributes the whole index.php page looses its formatting quite dramatically. The centre section (which contains the user greeting) disappears, both left & right _column(s) change width, the "OS Commerce" logo become left justified and the YMM box has no title.

Clearly the obvious answer is to keep a product with YMM attributes, but is this normal ??


This is a good find as I originally thought my installation was not performed correctly when I saw this. Once you create the first product YMM data the display errors disappears. I would think the easiest solution would be to create some default data within the SQL database when creating the new products_ymm Table, but I do not know enough about SQL to say this would work.

The only thing I want to change is to add a 4th drop down to use for submodel information, ie Make: Ford, Model: Focus, Year: 2010, Submodel: 2.0L. Has anyone added this to their install?

#48   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 03 April 2011 - 01:56

I'm still new to using OSC and I've attempted to install this module yet i'm stuck. In the read me file step 10 is:
10] install box from Admin >> Modules >>Boxes

I'm running OSC v2.2 RC2a with only a few modifications. I followed the manual route of editing of the files. The folders inside zipfile for YMM2.3.x has drop on top files>admin>includes> and newfiles>includes>modules>boxes. Inside the boxes folder there is a file named BM_year_make_model.php. MY version of OSC doesn't have an admin/modules/boxes. I'm stuck at how to add this PHP file into my store to test the rest of the edits. Any assistance would be greatly appreciated.

Thanks

#49   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 03 April 2011 - 03:25

Alex,

This version is for v2.3.1 ONLY. You will have to uninstall it and then download and install this version for RC2a: http://addons.oscommerce.com/info/6684




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

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#50   gt4dude

gt4dude
  • Members
  • 1 posts
  • Real Name:Mike W

Posted 03 April 2011 - 05:53

Filtering is not working on product listings.

Also the categories box is failing to show the number of listings in sub-cats which contain universal items.

#51   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 03 April 2011 - 10:48

Mike,

If you look in this thread you will find a code change for that. I am will be updating the download in a couple of weeks to reflect the changes mentioned.




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

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#52   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 03 April 2011 - 16:05

Alex,

This version is for v2.3.1 ONLY. You will have to uninstall it and then download and install this version for RC2a: http://addons.oscommerce.com/info/6684




Chris

I've sent you a PM. I'm hesitant to run the other addon due to the "auto installer" and I don't want it to break a production environment store.

Thanks
Alex

#53   RMD27

RMD27
  • Members
  • 415 posts
  • Real Name:Ricardo
  • Gender:Male

Posted 20 April 2011 - 08:34

Hi Ricardo,


I am sure YMM can be altered to integrate fields into existing tables, but this would require SQL paths to be altered. It isn't a bad idea, perhaps someone with more time will make a transition version.



Chris


Hello Chris
Im still finding an easy way to make this happen [img]http://forums.oscommerce.com/public/style_emoticons/default/smile.gif[/img]

Is it possible to create the same ymm fields in the product description table and have the fields in the ymm table pull the data from these new fields in the product description table?

Most importantly of all, is it possible to do easily [img]http://forums.oscommerce.com/public/style_emoticons/default/blush.gif[/img]

#54   amarangos

amarangos
  • Members
  • 3 posts
  • Real Name:Deez
  • Gender:Male

Posted 20 April 2011 - 22:03

To Dunweb:
In bm_year_make_model.php find the following line

$javascript = '<script language="javascript" type="text/javascript">
var a = new Array();
var b = new Array();
var c = new Array();';

and change it to

$javascript = '<script language="javascript" type="text/javascript">
//<![CDATA[
var a = new Array();
var b = new Array();
var c = new Array();';

Edited by amarangos, 20 April 2011 - 22:04.


#55   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 21 April 2011 - 03:51

Alex,

This version is for v2.3.1 ONLY. You will have to uninstall it and then download and install this version for RC2a: http://addons.oscommerce.com/info/6684

Chris


New 2.3.1 store, module r01 installed and approx 30K parts in database with a handful tagged for filtering. I'm noticing that some parts show up duplicated. Not all parts not all makes. If you filter by Jeep TJ unlimited http://mods4rides.dyndns.org you will notice a few parts are duplicated. 3 of the 10 parts are duplicated.

I used all drop on top files and then thought maybe they had an issue so I took the readme steps and applied them to as many files as I thought could cause this yet no change.

Suggestions?

Edited by mods4rides, 21 April 2011 - 03:55.


#56   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 21 April 2011 - 05:27

New 2.3.1 store, module r01 installed and approx 30K parts in database with a handful tagged for filtering. I'm noticing that some parts show up duplicated. Not all parts not all makes. If you filter by Jeep TJ unlimited http://mods4rides.dyndns.org you will notice a few parts are duplicated. 3 of the 10 parts are duplicated.I used all drop on top files and then thought maybe they had an issue so I took the readme steps and applied them to as many files as I thought could cause this yet no change.Suggestions?



Alex,

If your products a duplicated with the LINK mode into different categories then they would appear duplicated in the filter.


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

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#57   amarangos

amarangos
  • Members
  • 3 posts
  • Real Name:Deez
  • Gender:Male

Posted 21 April 2011 - 16:18

To Dunweb:

Me again, I made some changes to bm_make_model_year.php so that it is more XHTML 1.0 Transitional WC3 compliant as I was recently validating my test site. Nothing crazy, just a couple of &amp; instead of &, //<![CDATA[ in the javascript, and a couple of </br>. The minor changes helped me clean up a majority of the errors I was getting. Figured I would share what I changed:

To everyone else, feel free to use this at your own risk, I wouldn't use this on a production site until Dunweb has a chance to look at it and approve/disapprove, perhaps incorporate it into the next release.

<?php
class bm_year_make_model {
    var $code = 'bm_year_make_model';
    var $group = 'boxes';
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

	function bm_year_make_model() {
      $this->title = MODULE_BOXES_YEAR_MAKE_MODEL_TITLE;
      $this->description = MODULE_BOXES_YEAR_MAKE_MODEL_DESCRIPTION;

      if ( defined('MODULE_BOXES_YEAR_MAKE_MODEL_STATUS') ) {
        $this->sort_order = MODULE_BOXES_YEAR_MAKE_MODEL_SORT_ORDER;
        $this->enabled = (MODULE_BOXES_YEAR_MAKE_MODEL_STATUS == 'True');

        $this->group = ((MODULE_BOXES_YEAR_MAKE_MODEL_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
      }
    }

	function execute() {
      global $HTTP_GET_VARS, $languages_id, $currencies, $oscTemplate, $Make_selected_var, $Model_selected_var, $Year_selected_var;

		$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)) {
			$ymm_list = '<div class="ui-widget infoBoxContainer">' .
                  '  <div class="ui-widget-header infoBoxHeading">'. MODULE_BOXES_YEAR_MAKE_MODEL_TITLE . '</div>';
			$ymm_list .= '<div class="ui-widget-content infoBoxContents" style="text-align: center;">';
			$Make_array[] = array('id' => 'all', 'text' => 'Choose Vehicle');
		$Model_array[] = array('id' => 'all', 'text' => 'Choose Model');
		$Year_array[] = array('id' => 0, 'text' => 'Choose Year');

		   $javascript = '<script language="javascript" type="text/javascript">
//<![CDATA[
		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 != ''){
					$HTTP_GET_VARS['cPath'] = $cPath;
					$link = 'index.php?cPath='.$cPath.'&amp;Make=all&amp;Model=all&amp;Year=0';			
				} else {
					$link = 'index.php?Make=all&amp;Model=all&amp;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&amp;Model=all&amp;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&amp;Model=all&amp;Year=0';			
			}
				
			  reset($HTTP_GET_VARS);
			  while (list($key, $value) = each($HTTP_GET_VARS)) {
				if (!in_array($key,$keys)) 
				  $hidden_get_variables .= tep_draw_hidden_field($key, $value);
			  }	
		}
			$ymm_list .= $javascript.tep_draw_form('make_model_year', $action, 'get').tep_draw_pull_down_menu('Make', $Make_array, (isset($Make_selected_var) ? $Make_selected_var : ''), 'onChange="pop_model();"  style="width: 100%"') .'<br/><br/>'.
								    '<span id="model_select">'.tep_draw_pull_down_menu('Model', $Model_array, (isset($Model_selected_var) ? $Model_selected_var : ''), 'style="width: 100%"') .'</span><br/><br/>'.
								    '<span id="year_select">'.tep_draw_pull_down_menu('Year', $Year_array, (isset($Year_selected_var) ? $Year_selected_var : ''), 'onChange="document.make_model_year.submit();" style="width: 100%"') .'</span><br/><br/>'. 
									$hidden_get_variables . tep_hide_session_id() .
									'<input type="submit" value="Go">&nbsp;&nbsp;&nbsp;<a href="'.$link.'/>">Clear Vehicle</a></form>';

			$ymm_list .= ' </div>' .
                  '</div>';
			$oscTemplate->addBlock($ymm_list, $this->group);
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_BOXES_YEAR_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 Year Make Model Module', 'MODULE_BOXES_YEAR_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_YEAR_MAKE_MODEL_CONTENT_PLACEMENT', 'Right 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_YEAR_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_YEAR_MAKE_MODEL_STATUS', 'MODULE_BOXES_YEAR_MAKE_MODEL_CONTENT_PLACEMENT', 'MODULE_BOXES_YEAR_MAKE_MODEL_SORT_ORDER');
    }
}
?>


#58   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 22 April 2011 - 00:30

Alex,

If your products a duplicated with the LINK mode into different categories then they would appear duplicated in the filter.


Chris

Are you giving me brainstorm ideas or have you determined after looking at the site that this is what is happening? The parts I'm speaking of are not linked in other categories and the url states they are the same products_id. I have noticed that in the admin section of the catalog if I search for the product by name it selects it twice though the url has a slight difference:
cPath=132&pID=30545&action=new_product_preview
vs
cPath=137&pID=30545&action=new_product_preview

I have also noticed that while filtered the category counts each item so when I only have 2 parts it shows a count of 4.

I appreciate your assistance.

Edited by mods4rides, 22 April 2011 - 00:36.


#59   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 23 April 2011 - 14:34

Are you giving me brainstorm ideas or have you determined after looking at the site that this is what is happening?

Frustration set in not being able to figure out this riddle you left me with as when I installed a contribution that would allow me to view product_model in the admin side I still couldn't find any duplication. I finally gave up and decided to delete an offending part from the database and noticed i could chose which category to delete it from. Every search by using the product_model only returned the main category. Deleting from the 2nd category resolved the issue.

Thanks, in a round about way. Is there an easier way to find what products are in multiple categories other than stumbling on to them?

Edited by mods4rides, 23 April 2011 - 14:37.


#60   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 24 April 2011 - 05:50

Hi Dunweb,

I would like to start off with a big THANK YOU! This is brilliant and certainly can be the beginning of a solution I have been looking for to base my aftermarket parts sales ecommerce initiative from.

I have been in the auto industry for a bit and have grown extensively with IT. I have dug deep into PHP & MySQL, however Java is a bit new to me.

There are a few things I would love to ask you about, but I will begin with the first...

If you can take a look at www.stockwiseauto.com, you'll see your contribution there along with the
Browse By Categories 2.8 installed and running (found here http://addons.oscomm.../info/7959/v,23).

I only have one test product up now but here's my question:

Would there be an easy way to have the index.php page refresh with these "Browse By Categories" instead of All Products Matching? Meaning, I would like to refresh the main page with a list of all categories available for products matching their YMM.


I hope we can establish a casual dialogue regarding this contribution and my question above.

Look forward to hearing from you!


-Chris
StockWiseAuto

Edited by ckouris84, 24 April 2011 - 05:50.