Created
July 6, 2017 08:59
-
-
Save trytone/b6268951d43c171666688d0299be3b71 to your computer and use it in GitHub Desktop.
PrestaShop - Fix features with manufacturers filters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // replace this function in modules/blocklayered/blocklayered.php | |
| private static function getId_featureFilterSubQuery($filter_value, $ignore_join = false) | |
| { | |
| if (empty($filter_value)) | |
| return array(); | |
| $query_filters = ' AND EXISTS (SELECT * FROM '._DB_PREFIX_.'feature_product fp WHERE fp.id_product = p.id_product AND ('; | |
| foreach ($filter_value as $filter_val){ | |
| $query_filters .= 'fp.`id_feature_value` = '.(int)$filter_val.' OR '; | |
| } | |
| $query_filters = rtrim($query_filters, 'OR ').') '; | |
| $query_filters .= ')'; | |
| return array('where' => $query_filters); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment