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

#61   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 24 April 2011 - 06:28

In addition to this, after adding a few more test products & categories:

- Selecting a YMM brings up a page with filter products (not categories like I asked above) and the (OSC Stock)->Browse Categories box shows the fitment counts for the YMM as it should. However, when you click on any of these categories, other parts that shouldn't fit show up there too.

- This defeats the purpose of YMM lookup! I feel that on all pages, we need to filter out products that have a YMM entry but don't fit the currently selected vehicle, while leaving products that don't have any YMM entry to show up along products that have a YMM entry that are relevant to the currently selected YMM.

- This would be the only way we can have a true YMM filtered site and still offer "universal" parts & products.

If you can please help steer me in the right direction! I will poke around the code to gain a greater understanding in the meanwhile.

This is major! Please help /smile.gif' class='bbc_emoticon' alt=':)' />

-Chris

#62   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 24 April 2011 - 21:59

In addition to this, after adding a few more test products & categories:

- Selecting a YMM brings up a page with filter products (not categories like I asked above) and the (OSC Stock)->Browse Categories box shows the fitment counts for the YMM as it should. However, when you click on any of these categories, other parts that shouldn't fit show up there too.

- This defeats the purpose of YMM lookup! I feel that on all pages, we need to filter out products that have a YMM entry but don't fit the currently selected vehicle, while leaving products that don't have any YMM entry to show up along products that have a YMM entry that are relevant to the currently selected YMM.


I think you're missing the true beauty and simplicity that this modification brings. On my store if you select Jeep and GO you will find pages and pages of parts. If you decide to narrow it by clicking on performance (showing 21 jeep products) You wouldn't see the MSD ignition as that is a universal part. You state the other parts that shouldn't fit show up.... That only happens on mine if I didn't set a make and model. NO make/model means it is universal.... so the receiver plug that says Ford shows in "towing" regardless of brand, because the rig on the trailer may be a jeep and be towed by a Ford. Don't overly limit what your customers can see as you may limit your sales.

#63   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 25 April 2011 - 18:45

I think you're missing the true beauty and simplicity that this modification brings. On my store if you select Jeep and GO you will find pages and pages of parts. If you decide to narrow it by clicking on performance (showing 21 jeep products) You wouldn't see the MSD ignition as that is a universal part. You state the other parts that shouldn't fit show up.... That only happens on mine if I didn't set a make and model. NO make/model means it is universal.... so the receiver plug that says Ford shows in "towing" regardless of brand, because the rig on the trailer may be a jeep and be towed by a Ford. Don't overly limit what your customers can see as you may limit your sales.


Hi mods4rides,

I don't think I am missing the true beauty and simplicity at all.

I have been involved with Amazon & eBay's automotive initiatives since they started and I am quite familiar with the flaws they had and the things they did to improve sales. I have also made a lot of suggestions to try and help them but it's hard to steer ships like those on a dime...

Now I don't want to discredit your beliefs in the site you run, nor the great effort put forth by DunWeb and his predecessor on this contribution.

What I want to explain to you is simple:

On the site that I set up with this YMM contribution, www.stockwiseauto.com, you will find two products:

- Timken 513121
- Timken SP580310

When you choose one of the two vehicles in the YMM Box, the one that fits shows up in the middle of the page and that's great...but when you click on a category on the left and browse back to Hub Assemblies, you will see that both of them show up.

I have the YMM Box configured to "Yes" for "categories listing". Isn't this supposed to filter what you see on site to the vehicle you selected? If I was to have 50,000 products in all different types of categories...the customer will see everything after he starts browsing categories and not just the parts that fit.

Also, the reason why I mention to have either of these show up

1) products that fit the selected YMM
2) products that are universal

...is because if you were to categorize tools to aid a customer doing a brake job in the brake category, these would show up along with the brake pads & rotors that fit...it would be the best situation ideally.

If you have a look at your site, it behaves exactly how mine does and I know it's wrong and it will confuse customers.

For instance:

On your site if you were to select a Toyota FJ 2007, it seems there is 2 products in the performance category that fits...but you cannot narrow them down at all. Do you really think it's helping the customer?

When a customer chooses a YMM, we need to filter out anything that has a YMM and doesn't fit, only to leave items that have a YMM or don't have a specified YMM and thus considered "Universal".

DunWeb, can you please interject?

Thank you,

-CK

Edited by ckouris84, 25 April 2011 - 18:48.


#64   DunWeb

DunWeb

    The Censored One

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

Posted 25 April 2011 - 19:21

Hi Chris,

This contribution was just an update from the previous version of the same contribution for v2.2. I made very little changes to the original contribution so much of this was not coded by me. Please feel free to update the code as you see fit and upload a revised contribution to the add on area.





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)

#65   RMD27

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

Posted 26 April 2011 - 07:04

Hi mods4rides,

I don't think I am missing the true beauty and simplicity at all.

I have been involved with Amazon & eBay's automotive initiatives since they started and I am quite familiar with the flaws they had and the things they did to improve sales. I have also made a lot of suggestions to try and help them but it's hard to steer ships like those on a dime...

Now I don't want to discredit your beliefs in the site you run, nor the great effort put forth by DunWeb and his predecessor on this contribution.

What I want to explain to you is simple:

On the site that I set up with this YMM contribution, www.stockwiseauto.com, you will find two products:

- Timken 513121
- Timken SP580310

When you choose one of the two vehicles in the YMM Box, the one that fits shows up in the middle of the page and that's great...but when you click on a category on the left and browse back to Hub Assemblies, you will see that both of them show up.

I have the YMM Box configured to "Yes" for "categories listing". Isn't this supposed to filter what you see on site to the vehicle you selected? If I was to have 50,000 products in all different types of categories...the customer will see everything after he starts browsing categories and not just the parts that fit.

Also, the reason why I mention to have either of these show up

1) products that fit the selected YMM
2) products that are universal

...is because if you were to categorize tools to aid a customer doing a brake job in the brake category, these would show up along with the brake pads & rotors that fit...it would be the best situation ideally.

If you have a look at your site, it behaves exactly how mine does and I know it's wrong and it will confuse customers.

For instance:

On your site if you were to select a Toyota FJ 2007, it seems there is 2 products in the performance category that fits...but you cannot narrow them down at all. Do you really think it's helping the customer?

When a customer chooses a YMM, we need to filter out anything that has a YMM and doesn't fit, only to leave items that have a YMM or don't have a specified YMM and thus considered "Universal".

DunWeb, can you please interject?

Thank you,

-CK


If I can interject. About what you say about the filter not working when you browse back to hub assemblies. It works for me, only one hub shows. About mods 4 rides shop, it seems to filter by category just fine. maybe I am misunderstanding the point you are making

#66   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 26 April 2011 - 14:30

If I can interject. About what you say about the filter not working when you browse back to hub assemblies. It works for me, only one hub shows. About mods 4 rides shop, it seems to filter by category just fine. maybe I am misunderstanding the point you are making


It is working because I stayed up last night and revised the code!

Thanks /smile.gif' class='bbc_emoticon' alt=':)' />

#67   amarangos

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

Posted 03 May 2011 - 20:40

It is working because I stayed up last night and revised the code!

Thanks



Any chance you would like to share what you changed in the code?

#68   sportstolen

sportstolen
  • Members
  • 88 posts
  • Real Name:Johan Karlberg

Posted 07 May 2011 - 12:17

Hi!

Is it possible to only view those products that we have edit to an specific car model?

I want to edit all products but it will take to much time to do it in one time, therefor its better that customers only can view products that we have edit.

Hope you understand me /smile.gif' class='bbc_emoticon' alt=':)' />

#69   p0yo77

p0yo77
  • Members
  • 2 posts
  • Real Name:Ory Medina

Posted 15 May 2011 - 08:56

Hey Big thanks for the add on, it's fantastic and saved me a looooot of time, at first it didn't worked but with a few changes it started to work just fine, also i've made some changes to the code and would like to contribute.

I've corrected the formatting in the Box
and i've added a Combobox in the edit Product page so you dont get any typos or any error like that.

#70   p0yo77

p0yo77
  • Members
  • 2 posts
  • Real Name:Ory Medina

Posted 16 May 2011 - 05:11

Hey Big thanks for the add on, it's fantastic and saved me a looooot of time, at first it didn't worked but with a few changes it started to work just fine, also i've made some changes to the code and would like to contribute.

I've corrected the formatting in the Box
and i've added a Combobox in the edit Product page so you dont get any typos or any error like that.


in case you've already installed the add on and you want the Combo boxes in the product edit page, here are the instructions to do it

http://www.comonew.com/changes.txt

any questions feel free to contact me at poyo77 at gmail.com

#71   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 16 May 2011 - 14:36

Hello p0yo77,

Thank you for sharing your update on the contribution. I see that the only change you made to the formatting was moving where the $ymm_list begins its declaration and you really didn't change anything with the formatting other than renaming the drop-down/combobox titles. I think you moved the code to a better place but you haven't changed much there.

However, as far as your drop-down addition to the categories.php...that's brilliant! Very good idea and it's very much appreciated.

amarangos,

I would love to share my code, however it has been modified so heavily that I cannot deliver a clean "upgrade" to the contribution page. However, I would love to help you with any questions or things that you need changed on your current OSC install with this YMM contribution. Let me know what you would like to do and I can certainly help point you in the direction you need!


Thank you all!

-Chris

#72   ckouris84

ckouris84
  • Members
  • 7 posts
  • Real Name:Chris

Posted 16 May 2011 - 14:42

p0yo77,

I noticed that on the categories.php code edit you made to quickly add a previously entered YMM, it will only add tot he following empty YMM box and it would be great if we can figure out how to shift to the very next empty YMM entry box per click.

/smile.gif' class='bbc_emoticon' alt=':)' />

-Chris

#73   mods4rides

mods4rides
  • Members
  • 12 posts
  • Real Name:Alex

Posted 19 May 2011 - 02:46

Hello p0yo77,

Thank you for sharing your update on the contribution. I see that the only change you made to the formatting was moving where the $ymm_list begins its declaration and you really didn't change anything with the formatting other than renaming the drop-down/combobox titles. I think you moved the code to a better place but you haven't changed much there.

However, as far as your drop-down addition to the categories.php...that's brilliant! Very good idea and it's very much appreciated.
-Chris


I agree the addition is much welcome, and makes me want to share the tweaks I've found helped my store display multiple makes/models better.
With standard CSS parts that fit a GMC or a Chevrolet truck are quite an eyesore.
[img]http://s3.postimage.org/rtd3un7pz/badformat.png[/img]
image hosting service

after tinkering with the stylesheet.css I came up with this:
[img]http://s1.postimage.org/uu5um29f1/goodformat.png[/img]
post image wordpress

To get this changed modify your stylesheet.css specifically for YMM to:
#ymm ul li {
  list-style-type: none;
width:180px;
margin:10px 0 0 0;
padding:0 5px 0 0;
line-height:10px;
float:left;
display:inline;
}

#ymmopt ul li {
  list-style-type: none;
width:180px;
margin:10px 0 0 0;
padding:0 5px 0 0;
line-height:10px;
float:left;
display:inline;
}

You can find those at the very bottom of the drop on top files.

#74   HaaGeN

HaaGeN
  • Members
  • 4 posts
  • Real Name:haagen

Posted 02 June 2011 - 12:59

Hello all,

Do you think it's possible to manage Date with month ??

For a model :
Instead of setting up : 2000 - 2011
To be able to set up : 01 2000 - 01 2011 - or - January 2000 - January 2011

Thx for answer.

HäaGeN

#75   Psytanium

Psytanium
  • Members
  • 186 posts
  • Real Name:Psytanium
  • Gender:Male

Posted 09 June 2011 - 03:00

hi, i'm deploying the add-on on my website, everything worked fine till i reached the FINAL step, 9.b :s i'm can't find in index this syntax: include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>
</div>
<?php
}

i have a similar one, im not sure about it or where should i insert the new replacement : include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
?>

<?php echo tep_draw_content_bottom();?>

<?php
} 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();?><br />
</div >


thank you so much for working on this useful add-on, and thank you for any feed back about my problem with the final step /smile.gif' class='bbc_emoticon' alt=':)' />

#76   Psytanium

Psytanium
  • Members
  • 186 posts
  • Real Name:Psytanium
  • Gender:Male

Posted 10 June 2011 - 13:00

i purchased an oscommerce template so i can i have a website for my cars spare parts shop. so as you can see, my template isn't clean, but everything went right till i reached step 9, i'm just asking where to rep[lace and insert step 9.a and 9.b, ill post my all index.php code:

<?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
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) {
$categories_row = $categories['total'];
// 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 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 c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}

$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">'. "\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).'px;">'. "\n".
' <div class="pic_padd wrapper_pic_div" style="width:'.(SUBCATEGORY_IMAGE_WIDTH).'px;height:'.(SUBCATEGORY_IMAGE_HEIGHT).'px;">'.$p_pic.'</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
} 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();?><br />
</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');
?>

#77   Psytanium

Psytanium
  • Members
  • 186 posts
  • Real Name:Psytanium
  • Gender:Male

Posted 10 June 2011 - 22:27

hi again, sorry for posting frequently, i have installed a fresh copy of osc 2.3.1 and i tried both methods, manually and drop-on-top-files, but the results are the same:
the filter worked fine with New Products (on the home page) and with categories.
problems i found:
1- ymm is not filtering the products on the final level of catalog (number of products is correct but the content is listing all the products)
2- then "if you go back" to the main page the filter value remain the same BUT the page is posting all the products unfiltered.
3- in the admin page, if i insert a product with the value All, it wont display inside the drop down box. ex: Honda all 0 - 0 (there is no Honda in the vehicle drop down list)

btw 9.b needs some revision, because its resulting an error next to the line - else { // default page

thank you for your efforts on developing this useful tools, wish i can help, but i'm not an expert.

-Ludwig

#78   papioane

papioane
  • Members
  • 2 posts
  • Real Name:stef

Posted 11 June 2011 - 06:34

Hi. Thank you for this great module. I have just one question.

Is there any way to add one more column in module? Example : Year/Make/Model/Engine type

Thank you! /thumbsup.gif' class='bbc_emoticon' alt=':thumbsup:' />

Edited by papioane, 11 June 2011 - 06:35.


#79   KeithSartorius

KeithSartorius
  • Members
  • 8 posts

Posted 25 June 2011 - 08:25

I cant figure out what I am doing wrong. I have a fresh install did the drop in files. Added the sql calls and they created and inserted.
Went into the boxes and this mod is not showing! Any help would be appreciated!

Thanks

#80   DunWeb

DunWeb

    The Censored One

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

Posted 25 June 2011 - 23:10

Keith,

Check your installation again. I have installed this add on into MANY standard and template sites without any problems. It functions as it is intended to and is quite a simple add on to install. Again, I suggest you check your installation again.




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)