Jump to content



Photo
* * * * * 5 votes

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


  • Please log in to reply
261 replies to this topic

#141   DunWeb

DunWeb

    The Censored One

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

Posted 10 May 2012 - 22:45

@GoTTi

this mod doesnt have to work on sites for autoparts right? i can use this for other types of sites with similar idea and just change some code around for the labeling im assuming?



That is correct !



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)

#142 ONLINE   kymation

kymation

    Code Monkey

  • Community Sponsor
  • 8,014 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 10 May 2012 - 23:08

Or you could use Products Specifications and not have to make any code changes.

Regards
Jim

My Addons

Banners Box Download Support
Categories Accordion Box Download Support
Closest Shipper 2.2x Support
Document Manager 2.2x Support
Generic Box Download Support
Get 1 Free 2.2x Support
Price in Cart Only/MAPP Download Support
Modular Front Page Download Support
Modular SEO Header Tags Download Support
MVS 2.2x Support
PDF Datasheet Download Support
Price Updater 2.2x
Products Specifications 2.3.x Development Version Support Bugs/Suggestions
Request a Review Download Support

Shopping List Download Support New!
Specials Image Overlay Download Support
Superfish Categories Box Download Support
Theme Switcher 2.3+ Support  Updated


#143   testu

testu
  • Members
  • 1 posts
  • Real Name:Mark DeLuca

Posted 21 June 2012 - 15:51

Hello,

I am having some problems installing this mod. Can anyone help me? I get this error:

Fatal error: Cannot redeclare YMM_get_categories_where() (previously declared in /home/pieseaut/public_html/includes/functions/general.php:1383) in /home/pieseaut/public_html/includes/functions/general.php on line 1485

#144   RonK

RonK

    RonK

  • Members
  • 2 posts
  • Real Name:Ron
  • Gender:Male

Posted 29 June 2012 - 20:38

Hello,

I am having some problems installing this mod. Can anyone help me? I get this error:

Fatal error: Cannot redeclare YMM_get_categories_where() (previously declared in /home/pieseaut/public_html/includes/functions/general.php:1383) in /home/pieseaut/public_html/includes/functions/general.php on line 1485


Double check the /home/site-me/public_html/includes/languages/english/modules/boxes folder to make sure bm_year_make_model.php has just defines for titles and no actual php code. This happened to me also and either I mistakenly loaded wrong file in english folders area or the download package has wrong file in wrong place. I did not double check the download package because I chalked it up as my mistake and went on after I fixed it. Although the error I got was about defining class again.

#145   RonK

RonK

    RonK

  • Members
  • 2 posts
  • Real Name:Ron
  • Gender:Male

Posted 29 June 2012 - 20:51

Another observation of mine, I research a lot of code and have a very large online presence using OSC. This contrib is one of the most powerful I have seen out there, (for my needs). This contrib can be manipulated to do much more than just a parts filter. The 2.3 version using ajax is quite the catch..... I have about 10 hours hack time so far and like very much what I see. I did not know the power of setting cookies and filters until now. I will be harnessing this power further and test my results quite soon. This add-on solves many categorie problems when you get above 900 plus categories. Allows a very precise navigation of your site by stepping in without huge database pulls. Seems fast but testing further is needed. Add a little memcache and this could be real big for me.

#146   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 29 June 2012 - 21:46

NOW HERE IS THE CODE THAT DONT WORK IF I FOLLOW THE YMM GUIDE

<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2010 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

// the following cPath references come from application_top.php
$category_depth = 'top';
if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$categories_products = tep_db_fetch_array($categories_products_query);
if ($categories_products['total'] > 0) {
$category_depth = 'products'; // display products
} else {
$category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
$category_parent = tep_db_fetch_array($category_parent_query);
if ($category_parent['total'] > 0) {
$category_depth = 'nested'; // navigate through the categories
} else {
$category_depth = 'products'; // category has no products, but display the 'no products' message
}
}
}

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);
$tab_sel = tep_href_link(FILENAME_DEFAULT);
?>
<?php
require(DIR_WS_INCLUDES . 'template_top.php');
?>

<?php
if ($category_depth == 'nested') {
$category_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
$category = tep_db_fetch_array($category_query);
?>

<?php echo tep_draw_content_top();?>

<?php echo tep_draw_title_top();?>
<h1><?php echo $category['categories_name']; ?></h1>
<?php echo tep_draw_title_bottom();?>

<div class="contentContainer page_un">

<?php

//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$category_links[$i],$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$current_category_id,$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}
//eof Year_Make_Model Contribution v2.3.x by Dunweb Designs

$number_of_categories = tep_db_num_rows($categories_query);

$rows = 0;

$col = 0;
$row = 0;
// $col_items = (MAX_DISPLAY_CATEGORIES_PER_ROW - 1);

$prods_content = '
<div class="padding ofh">'. "\n";
$prods_content .= ' <ul class="sub_categories">'. "\n";
while ($categories = tep_db_fetch_array($categories_query)) {
$rows++;
$cPath_new = tep_get_path($categories['categories_id']);
$p_name = '<span><a href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . $categories['categories_name'] . '</a></span>';
$p_pic = '<a class="prods_pic_bg" href="' . tep_href_link(FILENAME_DEFAULT, $cPath_new) . '" style="width:'.(SUBCATEGORY_IMAGE_WIDTH + 2).'px;height:'.(SUBCATEGORY_IMAGE_HEIGHT + 2).'px;">' . tep_image(DIR_WS_IMAGES . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '';
// $width = (int)(100 / $categories_row) . '%';

// if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) {
// $colspan = ((MAX_DISPLAY_CATEGORIES_PER_ROW * 2) - 1) ;


// if (($col === 0) && ($row != 0)) {
$prods_content .= ''. "\n"; // hor separator start
// }
// if ($col === 0) {
// $prods_content .= ' <ul class="sub_categories">'. "\n";
// }else {
// $prods_content .= ''; // vert separator start
// }

$prods_content .=
' <li class="prods_content" style="width:'.(SUBCATEGORY_IMAGE_WIDTH + 2).'px;">'. "\n".
' <div class="pic_padd wrapper_pic_div" style="width:'.(SUBCATEGORY_IMAGE_WIDTH + 2).'px;height:'.(SUBCATEGORY_IMAGE_HEIGHT + 2).'px;">'.$p_pic.''.tep_draw_prod_pic3_top().''.tep_draw_prod_pic3_bottom().'</a></div>'. "\n".
' <div class="name name_padd">'.$p_name.'</div>'. "\n".
' </li>'. "\n";

// $col ++;
// if ($col > $col_items) {
// $prods_content .= ''. "\n"; // hor separator start
// $row ++;
// $col = 0;
// }else{
// $prods_content .= ''. "\n"; // vert separator end
// }

// }
}
$prods_content .= ' </ul>'. "\n";

$prods_content .= '</div>';
// needed for the new products module shown below
$new_products_category_id = $current_category_id;
?>
<div class="contentPadd un">
<?php echo $prods_content; ?>
</div>

<?php include(DIR_WS_MODULES . 'new_products.php'); ?>


</div><?php echo tep_draw_content_bottom();?>

<?php
} elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id'])) {
// create column list
$define_list = array('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_IMAGE' => PRODUCT_LIST_IMAGE,
'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_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;
}
}

// show the products of a specified manufacturer
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 . "'";
}
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sort'], 1);

switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER':
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}

$catname = HEADING_TITLE;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
} elseif ($current_category_id) {
$image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
}
?>

<?php echo tep_draw_content_top();?>

<?php echo tep_draw_title_top();?>
<h1><?php echo $catname; ?></h1>
<?php echo tep_draw_title_bottom();?>

<?php
// optional Product List Filter
if (PRODUCT_LIST_FILTER > 0) {
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
} else {
$filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
}
$filterlist_query = tep_db_query($filterlist_sql);
if (tep_db_num_rows($filterlist_query) > 1) {
echo tep_draw_form('filter', FILENAME_DEFAULT, 'get') . '<p class="show">' . TEXT_SHOW . '&nbsp;';
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
$options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
} else {
echo tep_draw_hidden_field('cPath', $cPath);
$options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
}
echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
while ($filterlist = tep_db_fetch_array($filterlist_query)) {
$options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
}
echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()" class="select"');
echo tep_hide_session_id() . '</p></form>' . "\n";
// echo '<div class="prods_hseparator">'.tep_draw_separator('spacer.gif', '1', '1').'</div>';
}
}

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

<?php echo tep_draw_content_bottom();?>

<?php
}
//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs

elseif($_GET['Make'] || $_GET['Model'] || $_GET['Year']){

$define_list = array('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_IMAGE' => PRODUCT_LIST_IMAGE,
'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_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($current_category_id){
$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 . "'";
}else{
$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 . "'";
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sort'], 1);

switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER':
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}

$catname = HEADING_TITLE;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
} elseif ($current_category_id) {
$image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
}
?>

<h1><?php echo $catname; ?></h1>

<div class="contentContainer">

<?php


include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
echo '</div>';

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

else { // default page
$first_page = true;
?>
<?php echo tep_draw_content_top();?>
<div class="none">

<?php echo tep_draw_title_top();?>
<h1><?php echo HEADING_TITLE; ?></h1>
<?php echo tep_draw_title_bottom();?>

</div >
<div class="contentContainer page_un">
<div class="contentText none">
<?php echo tep_customer_greeting(); ?>
</div>

<?php
if (tep_not_null(TEXT_MAIN)) {
?>

<div class="contentText">
<?php echo TEXT_MAIN; ?>
</div>

<?php
}
?>
<?php
include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS);
include(DIR_WS_MODULES . FILENAME_UPCOMING_PRODUCTS);
?>

</div>
<?php echo tep_draw_content_bottom();?>
<?php
}

require(DIR_WS_INCLUDES . 'template_bottom.php');
require(DIR_WS_INCLUDES . 'application_bottom.php');
?>






I am having the exact same problem. I purchased a template and everything looks fine during installation, except step 9b where I have add codes into [catalog]/index.php

My index.php file is different from the standard one, I realise I need to adjust the code somehow to make it work with my template, but can someone point me to the right direction? Where do I even begin?...

Any advice will help...

Thank You!

#147   DunWeb

DunWeb

    The Censored One

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

Posted 29 June 2012 - 21:58

@willer2k

Although some of your template code is altered and out of sequence, the contribution will work. However, you will need to change the placement of the code edits in the index.php to accommodate the template layout.




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)

#148   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 29 June 2012 - 22:15

Further question, can someone tell me what this code does? :


9.b]
Find:

include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

</div>

<?php
}

Add after:


//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs

elseif($_GET['Make'] || $_GET['Model'] || $_GET['Year']){

$define_list = array('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_IMAGE' => PRODUCT_LIST_IMAGE,
'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_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($current_category_id){
$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 . "'";
}else{
$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 . "'";
}

if ( (!isset($HTTP_GET_VARS['sort'])) || (!preg_match('/^[1-8][ad]$/', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
$HTTP_GET_VARS['sort'] = $i+1 . 'a';
$listing_sql .= " order by pd.products_name";
break;
}
}
} else {
$sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
$sort_order = substr($HTTP_GET_VARS['sort'], 1);

switch ($column_list[$sort_col-1]) {
case 'PRODUCT_LIST_MODEL':
$listing_sql .= " order by p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_NAME':
$listing_sql .= " order by pd.products_name " . ($sort_order == 'd' ? 'desc' : '');
break;
case 'PRODUCT_LIST_MANUFACTURER':
$listing_sql .= " order by m.manufacturers_name " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_QUANTITY':
$listing_sql .= " order by p.products_quantity " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_IMAGE':
$listing_sql .= " order by pd.products_name";
break;
case 'PRODUCT_LIST_WEIGHT':
$listing_sql .= " order by p.products_weight " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
case 'PRODUCT_LIST_PRICE':
$listing_sql .= " order by final_price " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name";
break;
}
}

$catname = HEADING_TITLE;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$image = tep_db_query("select manufacturers_image, manufacturers_name as catname from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
} elseif ($current_category_id) {
$image = tep_db_query("select c.categories_image, cd.categories_name as catname from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$image = tep_db_fetch_array($image);
$catname = $image['catname'];
}
?>

<h1><?php echo $catname; ?></h1>

<div class="contentContainer">

<?php


include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
echo '</div>';

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











If I know what the code actually does, it will greatly help to fix the issue i'm facing.
Thanks!

#149   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 29 June 2012 - 22:19

@willer2k

Although some of your template code is altered and out of sequence, the contribution will work. However, you will need to change the placement of the code edits in the index.php to accommodate the template layout.




Chris


Hey Chris, so if I understand correctly, I don't need to modify the codes, I just need to find the right place to input the code?

BTW, thank you so much for such a quick reply, I didn't except help so quickly! /biggrin.png' class='bbc_emoticon' alt=':D' />

#150   DunWeb

DunWeb

    The Censored One

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

Posted 30 June 2012 - 03:40

@willer2k

That is correct, your template isn't too badly coded based on the index.php you provided, I suggest playing with the YMM code placement for optimal layout placement.



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)

#151   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 01 July 2012 - 03:23

@willer2k

That is correct, your template isn't too badly coded based on the index.php you provided, I suggest playing with the YMM code placement for optimal layout placement.



Chris


Thanks Chris! /biggrin.png' class='bbc_emoticon' alt=':D' />

#152   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 01 July 2012 - 15:45

@DunWeb

hey chris, I finally managed to get the contribution to work! (somewhat) yay!

The only problem I am facing right now thou, is that when I put the year/make/model/part(engine size), the filter works, but when i go to a different category, say, from brakes rotors to radiators, the filter stops working and shows me all radiators I have.

In the navigation tree, it shows "Radiators (1)" witch is true, I only have one radiotor for that specific car, but when I go to radiators, it shows ALL radiators I have.



Also, I dont know if its normal, but in [catalog]/admin , in configuration/year make model, its empty. I can't configure anything their.

Anyways, ANYTHING will help! Thanks guys.

#153   willer2k

willer2k
  • Members
  • 46 posts
  • Real Name:Alex
  • Gender:Male
  • Location:Toronto

Posted 03 July 2012 - 10:33

@DunWeb


-UPDATE-

I've been informed that it might be possible to fix this issue I am facing by passing the variables into the links for the categories, so this way when you click on a category, it applies all the specified "YMMP" attributes to filter a category's contents, would you have any idea how to do that??

Does anyone know??

#154   motrax

motrax
  • Members
  • 7 posts

Posted 20 August 2012 - 16:02

I've got a problem from my site, for some reason it's no longer actually filtering the products out correctly, nor displaying the universal products correctly.

The product counts filter correctly, but they just don't display the universal products, or actually filter out the products in reality.

My site is www.theautojumble.com

Any suggestions greatly appreciated!!

#155   DunWeb

DunWeb

    The Censored One

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

Posted 20 August 2012 - 17:46

@motrax

What has changed on the site ? If it was working, what changed to make it not work ?



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)

#156   motrax

motrax
  • Members
  • 7 posts

Posted 21 August 2012 - 08:31

Problem is, I can't remember what I last did to it, It's been some time since I did anything to it and it's been on the back-burner for a while.

When I returned to it I realised it wasn't filtering right, and can't for the life of me see why...

#157   motrax

motrax
  • Members
  • 7 posts

Posted 07 September 2012 - 13:38

Right, have put a fresh install of OSC on, and installed ONLY YMM. Still having the same issue!

Any ideas from anyone would be greatly appreciated. I'm really at a loss with this.

Thanks,
Rob

#158   CrazyCarzCustoms

CrazyCarzCustoms
  • Members
  • 151 posts
  • Real Name:Rob
  • Gender:Male
  • Location:Oliveira do Hospital - Portugal

Posted 13 September 2012 - 13:24

Hi,

I would like to know if it would be possible to have the addon just on selected pages , we sell car accessories , paint , pigments and airbrush paints and i would like to have this just visible on the accessories pages.

Also , could the ui be made like you see here : http://www.demon-twe...74/26653/filter

Thanks,

Rob

#159   motrax

motrax
  • Members
  • 7 posts

Posted 21 September 2012 - 09:57

@motrax

What has changed on the site ? If it was working, what changed to make it not work ?



Chris


I seem to have the same problem as willer2k, I don't know if anyone has a resolution to this, but any help would be most appreciated, have re-installed to no avail.

@willer2k, Did you ever get anywhere with fixing this bug?

Thanks,
Rob

Edited by motrax, 21 September 2012 - 09:58.


#160   rlacava

rlacava
  • Members
  • 1 posts
  • Real Name:Richard

Posted 21 September 2012 - 14:48

Hi


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.3.1 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 and New Files and could't find Admin >> Modules >>Box.

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