Hi
About the filters.
I think the filters , always filters all authors, series, etc... even if they don't have a book associated.
But there's a option, on listing, to display books out of stock from authors, etc...
But out of stock is different from a book id that doesn't exist anymore....
I've done this primary simple thing, to just filter series that has books associated. I think this makes sense, but probably I' missing something.
PHP Code:
$bookx_filter_values_query = 'SELECT DISTINCT bs.bookx_series_id, bsd.series_name, be.bookx_series_id
FROM ' . TABLE_PRODUCT_BOOKX_SERIES . ' bs
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_EXTRA . ' be ON bs.bookx_series_id = be.bookx_series_id
LEFT JOIN ' . TABLE_PRODUCT_BOOKX_SERIES_DESCRIPTION . ' bsd ON bs.bookx_series_id = bsd.bookx_series_id AND bsd.languages_id = "' . (int)$_SESSION['languages_id'] . '"'
. (!empty($extra_filter_query_parts['join_multi_filter']) ? $extra_filter_query_parts['join_multi_filter'] . ' ON be.bookx_series_id = bs.bookx_series_id ' : '')
. bookx_assemble_filter_extra_join($extra_filter_query_parts['join'], array('series'))
. ' WHERE 1 ' . bookx_assemble_filter_extra_where($extra_filter_query_parts['where'], array('series'))
. ' ORDER by bs.series_sort_order, bsd.series_name';
$bookx_series = $db->Execute ( $bookx_filter_values_query );
And on the while loop
PHP Code:
while ( ! $bookx_series->EOF ) {
if ($bookx_series->fields['bookx_series_id'] !='') {
$bookx_series_name = ((strlen ( $bookx_series->fields ['series_name'] ) > ( int ) BOOKX_MAX_DISPLAY_FILTER_DROPDOWN_LEN) ? substr ( $bookx_series->fields ['series_name'], 0, ( int ) BOOKX_MAX_DISPLAY_FILTER_DROPDOWN_LEN ) . '..' : $bookx_series->fields ['series_name']);
$bookx_series_array [] = array (
'id' => $bookx_series->fields ['bookx_series_id'],
'text' => $bookx_series_name
);
}
$bookx_series->MoveNext ();
}
I think this makes more sense ? , or could be a future to have in a configuration option....to list everything even if there's no books anymore.
But personalty, I think, that it's a lot of "dead" links for a customer.
Another nice feature, would be a admin routine, upon admin click, to delete all series, etc... that don't have books anymore.
Bookmarks