Zencart 1.5.4
Zen-Cart_Dynamic_Attribute_filter-1.3
I was getting an error on my sql file. I used the code below found in the thread to make Dynamic filters SQL file work
// We show them all
$listing_sql = "SELECT DISTINCT " . $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";
$listing_sql .= " FROM " . TABLE_PRODUCTS . " p" .
" LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
" LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id" .
" LEFT JOIN " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id" .
" JOIN " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.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 pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
and p2c.categories_id = '" . (int)$current_category_id . "'" .
$filter .
" GROUP BY p.products_id " .
$having .
$alpha_sort;
}
}
// eof dynamic filter 2 of 2
Now I have an error when I do a search. I need assistance with solving this error below if someone could assist me...
[03-Dec-2016 14:51:00 America/New_York] PHP Fatal error: 1054:Unknown column 'in_name' in 'order clause' :: SELECT p.products_id, p.products_price_sorter, p.master_categories_id, p.manufacturers_id FROM products p LEFT JOIN manufacturers m USING(manufacturers_id) LEFT JOIN products_description pd on p.products_id = pd.products_id JOIN products_to_categories p2c on p.products_id = p2c.products_id JOIN categories c on p2c.categories_id = c.categories_id LEFT JOIN meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1 WHERE (p.products_status = 1
AND pd.language_id = 1 AND ((pd.products_name LIKE '%aims%'
OR p.products_model
LIKE '%aims%'
OR m.manufacturers_name
LIKE '%aims%' OR (mtpd.metatags_keywords
LIKE '%aims%'
AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description
LIKE '%aims%'
AND mtpd.metatags_description !='') OR pd.products_description
LIKE '%aims%') and (pd.products_name LIKE '%power%'
OR p.products_model
LIKE '%power%'
OR m.manufacturers_name
LIKE '%power%' OR (mtpd.metatags_keywords
LIKE '%power%'
AND mtpd.metatags_keywords !='') OR (mtpd.metatags_description
LIKE '%power%'
AND mtpd.metatags_description !='') OR pd.products_description
LIKE '%power%') )) GROUP BY p.products_id order by in_name DESC, p.products_sort_order, pd.products_name ==> (as called by) C:\xampp\htdocs\xxx.com\includes\templates\theme871\sideboxes\tpl_dynamic_filter .php on line 63 <== in C:\xampp\htdocs\xxx.com\includes\classes\db\mysql\query_factory.php on line 292
Bookmarks