ZenCart – oprava chyby advanced search – 1054 Unknown column v rozšířeném vyhledávání
12. 3. 2020
Oprava rozšířeného vyhledávání – advanced search – 1054 Unknown column
Při zadání cenového rozmezí při rozšířeném hledání se objeví chyba:
1 2 3 4 5 6 7 8 9 |
1054 Unknown column 'p.products_tax_class_id' in 'on clause' in: [select count(distinct p.products_id) as total FROM products p LEFT JOIN manufacturers m USING(manufacturers_id), products_description pd, categories c, products_to_categories p2c LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 2 LEFT JOIN tax_rates tr ON p.products_tax_class_id = tr.tax_class_id LEFT JOIN zones_to_geo_zones gz ON tr.tax_zone_id = gz.geo_zone_id AND (gz.zone_country_id IS null OR gz.zone_country_id = 0 OR gz.zone_country_id = 56) AND (gz.zone_id IS null OR gz.zone_id = 0 OR gz.zone_id = 191) WHERE (p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id = 2 AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id ) AND (p.products_price_sorter * IF(gz.geo_zone_id IS null, 1, 1 + (tr.tax_rate / 100)) >= 10) AND (p.products_price_sorter * IF(gz.geo_zone_id IS null, 1, 1 + (tr.tax_rate / 100)) <= 100)] |
ZenCart verze 1.3.5
upravit soubor includes/modules/pages/advanced_search_result/header_php.php
Na řádku 215 změňte
1 2 3 4 5 6 |
$from_str = "FROM " . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = :languagesID"; |
na
1 2 3 4 5 6 |
$from_str = "FROM (" . TABLE_PRODUCTS . " p LEFT JOIN " . TABLE_MANUFACTURERS . " m USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = :languagesID)"; |
ZenCart verze 1.3.0.2
upravit soubor includes/modules/pages/advanced_search_result/header_php.php
změnit: (řádek 216)
1 2 3 4 5 6 |
$from_str = "FROM". TABLE_PRODUCTS. "p LEFT JOIN ". TABLE_MANUFACTURERS. "m USING(manufacturers_id), ". TABLE_PRODUCTS_DESCRIPTION. "pd,". TABLE_CATEGORIES. "c,". TABLE_PRODUCTS_TO_CATEGORIES. "p2c LEFT JOIN ". TABLE_META_TAGS_PRODUCTS_DESCRIPTION. "mtpd ON mtpd.products_id = p2c.products_id AND mtpd.language_id =:languagesID "; |
na:
1 2 3 4 5 6 |
$from_str = "FROM (" . TABLE_PRODUCTS . " p) LEFT JOIN ". TABLE_MANUFACTURERS. " m ON (p.manufacturers_id = m.manufacturers_id) LEFT JOIN ". TABLE_PRODUCTS_DESCRIPTION. " pd ON (p.products_id = pd.products_id) LEFT JOIN ". TABLE_PRODUCTS_TO_CATEGORIES. " p2c ON (p.products_id = p2c.products_id) LEFT JOIN ". TABLE_CATEGORIES. " c ON (c.categories_id = p2c.categories_id) LEFT JOIN ". TABLE_META_TAGS_PRODUCTS_DESCRIPTION. " mtpd ON (mtpd.products_id = p2c.products_id AND mtpd.language_id =:languagesID)"; |
a: (řádek 251)
1 2 3 4 5 |
$where_str = "WHERE p.products_status = 1 AND p.products_id = pd.products_id AND pd.language_id =:languagesID AND p.products_id = p2c.products_id AND p2c.categories_id = c.categories_id "; |
na:
1 2 3 |
$where_str = "WHERE p.products_status = 1 AND pd.language_id =:languagesID "; |
Napsat komentář