Sent via PM.
Printable View
Found it. The category being initially displayed has products that are still 'registered' in the site's products_to_categories table but not in the products_description.
Find this code on lines 29-62 of admin/includes/ih_manager.php
and change toCode:// set categories and products if not set
if ($products_filter == '' && $current_category_id > 0) {
$new_product_query = $db->Execute(
"SELECT ptc.products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
ON ptc.products_id = pd.products_id
AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
WHERE ptc.categories_id = " . (int)$current_category_id . "
ORDER BY pd.products_name"
);
$products_filter = ($new_product_query->EOF) ? '' : $new_product_query->fields['products_id'];
if ($products_filter !== '') {
zen_redirect(zen_href_link(FILENAME_IMAGE_HANDLER, 'ih_page=manager&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id));
}
} else {
if ($products_filter == '' && $current_category_id == '') {
$reset_categories_id = zen_get_category_tree('', '', '0', '', '', true);
$current_category_id = $reset_categories_id[0]['id'];
$new_product_query = $db->Execute(
"SELECT ptc.products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
ON ptc.products_id = pd.products_id
AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
WHERE ptc.categories_id = " . (int)$current_category_id . "
ORDER BY pd.products_name"
);
$products_filter = ($new_product_query->EOF) ? null : $new_product_query->fields['products_id'];
if ($products_filter === null) {
unset($_GET['products_filter']);
} else {
$_GET['products_filter'] = $products_filter;
}
}
}
That'll be included in a forth-coming v5.3.5 of IH-5; see this GitHub issue for tracking: https://github.com/lat9/zen_Image-Handler/issues/16Code:// set categories and products if not set
if ($products_filter == '' && $current_category_id > 0) {
$new_product_query = $db->Execute(
"SELECT ptc.products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
INNER JOIN " . TABLE_PRODUCTS . " p
ON p.products_id = ptc.products_id
INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
ON ptc.products_id = pd.products_id
AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
WHERE ptc.categories_id = " . (int)$current_category_id . "
ORDER BY pd.products_name"
);
$products_filter = ($new_product_query->EOF) ? '' : $new_product_query->fields['products_id'];
if ($products_filter !== '') {
zen_redirect(zen_href_link(FILENAME_IMAGE_HANDLER, 'ih_page=manager&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id));
}
} else {
if ($products_filter == '' && $current_category_id == '') {
$reset_categories_id = zen_get_category_tree('', '', '0', '', '', true);
$current_category_id = $reset_categories_id[0]['id'];
$new_product_query = $db->Execute(
"SELECT ptc.products_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
INNER JOIN " . TABLE_PRODUCTS . " p
ON p.products_id = ptc.products_id
INNER JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd
ON ptc.products_id = pd.products_id
AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
WHERE ptc.categories_id = " . (int)$current_category_id . "
ORDER BY pd.products_name"
);
$products_filter = ($new_product_query->EOF) ? null : $new_product_query->fields['products_id'];
if ($products_filter === null) {
unset($_GET['products_filter']);
} else {
$_GET['products_filter'] = $products_filter;
}
}
}
Any idea why I would see this error in the logs:
[15-Jun-2024 15:01:17 America/Los_Angeles] Request URI: /store/pl-cups-and-balls-by-pl-trick-p-28122.html, IP address: 66.249.66.83, Language id 1
#0 [internal function]: zen_debug_error_handler()
#1 /home/domain/public_html/store/includes/classes/bmz_image_handler.class.php(953): imagecreatefrompng()
#2 /home/domain/public_html/store/includes/classes/bmz_image_handler.class.php(750): ih_image->load_imageGD()
#3 /home/domain/public_html/store/includes/classes/bmz_image_handler.class.php(430): ih_image->resize_imageGD()
#4 /home/domain/public_html/store/includes/classes/bmz_image_handler.class.php(282): ih_image->get_resized_image()
#5 /home/domain/public_html/store/includes/functions/extra_functions/functions_bmz_image_handler.php(154): ih_image->get_local()
#6 /home/domain/public_html/store/includes/functions/html_output.php(215): handle_image()
#7 /home/domain/public_html/store/includes/modules/bootstrap/centerboxes/also_purchased_products.php(54): zen_image()
#8 /home/domain/public_html/store/includes/templates/bootstrap/centerboxes/tpl_modules_also_purchased_products.php(16): require('/home/domain/...')
#9 /home/domain/public_html/store/includes/templates/bootstrap/templates/tpl_product_info_display.php(707): require('/home/domain/...')
#10 /home/domain/public_html/store/includes/modules/pages/product_info/main_template_vars.php(160): require('/home/domain/...')
#11 /home/domain/public_html/store/includes/templates/bootstrap/common/tpl_main_page.php(268): require('/home/domain/...')
#12 /home/domain/public_html/store/index.php(94): require('/home/domain/...')
--> PHP Warning: imagecreatefrompng(): gd-png: libpng warning: iCCP: known incorrect sRGB profile in /home/domain/public_html/store/includes/classes/bmz_image_handler.class.php on line 953.
That's what I thought but it's displaying just fine. This is the link to the product (it has the main image and one additional image) and both load just fine:
https://www.mjmmagic.com/store/pl-cu...k-p-28122.html
Is it possible that the image can be corrupted and yet, still display just fine?
yes. I have run into that with a JPG that had been incorrectly renamed to PNG. Chrome could figure it out, but not GD.
v5.3.5 of Image Handler 5 is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2169
This release corrects issue #16: Correct product dropdown handling when products are misconfigured.