[Note: remember to include site URL, ZC version, list of plugins, PHP version, etc ... read the Posting Tips shown above for information to include in your post here. And, remove this comment before actually posting!]
Hello, i am quite green in PHP but learning .... as always.
I noted a strange behavior in the query below and scratching my head to understand it.
Then i copied the query in phpMyAdmin and noticed that the ". $and ." section was missing.
Checked the string length and it is 1023 bytes !!!
Then I taken out a couples of columns, reduce the length and ... YES it works fine.
Here are the information:
APACHE 2.4.7
MYSQL 5.6.15
PHP 5.5.8
Zip file: zen-cart-v1.5.6c-07162019
File: includes\index_filters\default_filter.php
PHP Code:
/**
* default_filter.php for index filters
*
* index filter for the default product type
* show the products of a specified manufacturer
*
* @package productTypes
* @copyright Copyright 2003-2019 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @todo Need to add/fine-tune ability to override or insert entry-points on a per-product-type basis
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Scott C Wilson 2019 Jun 23 Modified in v1.5.6c $
*/
//
//
//
line 53
$listing_sql = "SELECT " . $select_column_list . " p.products_id, p.products_type, p.master_categories_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description,
IF(s.status = 1, s.specials_new_products_price, NULL) AS specials_new_products_price,
IF(s.status = 1, s.specials_new_products_price, p.products_price) AS final_price,
p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status
FROM " . TABLE_PRODUCTS . " p
LEFT JOIN " . TABLE_SPECIALS . " s ON s.products_id = p.products_id
LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd ON pd.products_id = p.products_id
AND pd.language_id = " . (int)$_SESSION['languages_id'] . "
LEFT JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c ON p2c.products_id = p.products_id
LEFT JOIN " . TABLE_MANUFACTURERS . " m ON m.manufacturers_id = p.manufacturers_id
WHERE p.products_status = 1
" . $and . "
" . $alpha_sort;
Otherwise my system works.
Keep me posted please.
Claudio
Bookmarks