This module is working great but I'm having an issue on all the product pages (products_all, products_new, specials, featured_products). After doing the following adjustment to the header_php.php file (as instructions):
PHP Code:
*****
includes/modules/pages/products_all/header_php.php
*****
change lines 23 - 34 from this:
$products_all_query_raw = "SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,
p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
p.product_is_always_free_shipping, p.products_qty_box_status,
p.master_categories_id
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd
WHERE p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languageID " . $order_by;
$products_all_query_raw = $db->bindVars($products_all_query_raw, ':languageID', $_SESSION['languages_id'], 'integer');
$products_all_split = new splitPageResults($products_all_query_raw, MAX_DISPLAY_PRODUCTS_ALL);
// bof dynamic filter 1 of 1
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));
$listing_sql = "SELECT DISTINCT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price,
p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight,
p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)" .
" left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
" left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
($filter_attr == true ? " join " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" join " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " join " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1 AND (p.products_date_available IS NULL OR p.products_date_available <= current_date) AND pd.language_id = :languageID " .
$filter . " GROUP BY p.products_id " . $having . $order_by;
$listing_sql = $db->bindVars($listing_sql, ':languageID', $_SESSION['languages_id'], 'integer');
$products_all_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_ALL);
// eof dynamic filter 1 of 1
to this:
$products_all_query_raw = "SELECT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id,
p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight, p.product_is_call,
p.product_is_always_free_shipping, p.products_qty_box_status,
p.master_categories_id
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id),
"
. TABLE_PRODUCTS_TO_CATEGORIES . " p2c
LEFT JOIN " . TABLE_CATEGORIES_CUSTOMERS . " ccu
on p2c.categories_id = ccu.categories_id,
" . TABLE_PRODUCTS_DESCRIPTION . " pd
WHERE p.products_status = 1
AND p.products_id = pd.products_id
AND pd.language_id = :languageID
AND p.products_id = p2c.products_id
AND p2c.categories_id = ccu.categories_id
AND (ccu.customers_cat_group = '" . (int)$_SESSION['customers_cat_group'] . "' OR ccu.customers_cat_group = '0' )
" . $order_by;
$products_all_query_raw = $db->bindVars($products_all_query_raw, ':languageID', $_SESSION['languages_id'], 'integer');
$products_all_split = new splitPageResults($products_all_query_raw, MAX_DISPLAY_PRODUCTS_ALL);
The pages start to do few things incorrect:
-displays incorrect number of items listed (instead of decreasing the number this one goes up from 635 to 666);
-repeats items (I think this is why it increases the number of items);
-messes up the styling of the pages (very bad), this is probably the easiest issue of all to fix since it could be related to the template's grid and css.
That file section (and the other product pages headers) was already altered to this:
PHP Code:
// bof dynamic filter 1 of 1
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_DYNAMIC_FILTER));
$listing_sql = "SELECT DISTINCT p.products_type, p.products_id, pd.products_name, p.products_image, p.products_price,
p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight,
p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status, p.master_categories_id, m.manufacturers_id";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m ON (p.manufacturers_id = m.manufacturers_id)" .
" left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id" .
" left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
($filter_attr == true ? " join " . TABLE_PRODUCTS_ATTRIBUTES . " p2a on p.products_id = p2a.products_id" .
" join " . TABLE_PRODUCTS_OPTIONS . " po on p2a.options_id = po.products_options_id" .
" join " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov on p2a.options_values_id = pov.products_options_values_id" .
(defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') ? " join " . TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK . " p2as on p.products_id = p2as.products_id " : "") : '');
$listing_sql .= " WHERE p.products_status = 1 AND (p.products_date_available IS NULL OR p.products_date_available <= current_date) AND pd.language_id = :languageID " .
$filter . " GROUP BY p.products_id " . $having . $order_by;
$listing_sql = $db->bindVars($listing_sql, ':languageID', $_SESSION['languages_id'], 'integer');
$products_all_split = new splitPageResults($listing_sql, MAX_DISPLAY_PRODUCTS_ALL);
// eof dynamic filter 1 of 1
Please, let me know how I am supposed to change this portion for it to work properly.
Bookmarks