PHP Code:
if ($current_category_id == 0){
if($manufacturer){
$products_query_raw = "select p.products_id, p.products_type, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, pc.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and p.manufacturers_id = " . $manufacturer . " $sort_by ";
}else{
$products_query_raw = "select p.products_id, p.products_type, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, pc.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id $sort_by ";
}
} else {
if($manufacturer){
$products_query_raw = "select p.products_id, p.products_type, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, pc.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' and p.manufacturers_id = " . $manufacturer . " $sort_by ";
}else{
$products_query_raw = "select p.products_id, p.products_type, p.products_image, p.products_model, pd.products_name, p.products_status, p.products_weight, p.products_quantity, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, pc.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where p.products_id = pd.products_id and pd.language_id = '$languages_id' and p.products_id = pc.products_id and pc.categories_id = '" . $current_category_id . "' $sort_by ";
}
}
Finally, still in quick_updates.php, find the section of the document that starts with "//// links to preview or full edit" and replace the following two lines with this code:
PHP Code:
if(QUICKUPDATES_DISPLAY_PREVIEW == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".zen_href_link (FILENAME_PRODUCT, 'cPath='.$products['categories_id'].'&pID='.$products['products_id'].'&product_type='.$products['products_type'].'&action=new_product_preview&read=only&sort_by='.$sort_by.'&page='.$split_page.'&origin='.$origin)."\">". zen_image(DIR_WS_IMAGES . 'icon_info.gif', TEXT_IMAGE_PREVIEW) ."</a></td>\n";
if(QUICKUPDATES_DISPLAY_EDIT == 'true')echo "<td class=\"smallText\" align=\"left\"><a href=\"".zen_href_link (FILENAME_PRODUCT, 'cPath='.$products['categories_id'].'&pID='.$products['products_id'].'&product_type='.$products['products_type'].'&action=new_product')."\">". zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', TEXT_IMAGE_SWITCH_EDIT) ."</a></td>\n";
If you are using Quick Updates with Register Globals turned off (see my earlier post), you'll also want to add this line of code near the top of the document (right under [FONT="Courier New"]require('includes/application_top.php');[/FONT]):