This is a discussion on Show All Products in Category & Subcategories V1.0 within the New osCommerce Contributions forums, part of the osCommerce 2.2 Forums category; I believe I've solved the missing manufacturer and quantity issue. For those who have already installed the previous version one ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| ||||
| ||||
| For those who have already installed the previous version one change needs to be made as follows: Original Mod: // We show them all $cPathA = explode("_", $cPath); $size = sizeof($cPathA)-1; $subcategories_array = array(); tep_get_subcategories($subcategories_array, $cPathA[$size]); $size_sc = sizeof($subcategories_array); //Subcat count $cat_Search = "("; for($i = 0; $i < $size_sc; $i++){ $cat_Search .= "p2c.categories_id = '" . $subcategories_array[$i] . "' or "; } $cat_Search .= "p2c.categories_id = '" . $cPathA[$size] . "'" . ")"; $listing_sql = "select " . $_list . " p.products_image, pd.products_name, 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 " . $cat_Search . ""; Fixed Mod: // We show them all $cPathA = explode("_", $cPath); $size = sizeof($cPathA)-1; $subcategories_array = array(); tep_get_subcategories($subcategories_array, $cPathA[$size]); $size_sc = sizeof($subcategories_array); //Subcat count $cat_Search = "("; for($i = 0; $i < $size_sc; $i++){ $cat_Search .= "p2c.categories_id = '" . $subcategories_array[$i] . "' or "; } $cat_Search .= "p2c.categories_id = '" . $cPathA[$size] . "'" . ")"; $listing_sql = "select " . $select_column_list . " p.products_image, pd.products_name, 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 " . $cat_Search . ""; As you can see, just a simple change on last line where $_list should be $select_column_list. I have updated the install package and the instructions. Full package. More...
__________________ Michael Sasek osCMax Developer
|
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Show All Products in Category & Subcategories V1.0 | michael_s | New osCommerce Contributions | 0 | 08-25-2007 07:14 AM |
| Show All Products in Category & Subcategories V1.0 | michael_s | New osCommerce Contributions | 0 | 08-20-2007 09:14 PM |
| Show Subcategories and Products | michael_s | New osCommerce Contributions | 0 | 08-16-2007 10:00 AM |
| Show All Products in Category & Subcategories V1.0 | michael_s | New osCommerce Contributions | 0 | 08-10-2007 03:12 PM |
| Click Category, Display All Subcategories with Products | thor101 | osCommerce 2.2 Modification Help | 1 | 01-07-2007 09:49 PM |