Originally Posted by
mprough
Thanks swguy... If anyone needs this
Code:
// if only one product in this category, go directly to the product page, instead of displaying a link to just one item:
// if filter_id exists the 1 product redirect is ignored
if (SKIP_SINGLE_PRODUCT_CATEGORIES == 'True' && !isset($_GET['filter_id']) && !isset($_GET['alpha_filter_id'])) {
if ($listing->RecordCount() == 1) {
header('HTTP/1.1 301 Moved Permanently');
zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']));
}
}
What was the problem encountered when doing as recommended with:
Code:
// if only one product in this category, go directly to the product page, instead of displaying a link to just one item:
// if filter_id exists the 1 product redirect is ignored
if (SKIP_SINGLE_PRODUCT_CATEGORIES == 'True' && !isset($_GET['filter_id']) && !isset($_GET['alpha_filter_id'])) {
if ($listing->RecordCount() == 1) {
zen_redirect(zen_href_link(zen_get_info_page($listing->fields['products_id']), ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing->fields['products_id']), 301);
}
}
If none, perhaps could enlighten on why the alternate choice.
Bookmarks