Frenchy Posted May 17, 2018 Share Posted May 17, 2018 Hello, I'm trying to get all product by feature name in SQL. I have some difficulties with Prestashop Database Architecture. I know there is the feature_value_lang with the value of feature and the id_feature_value.I know there is the feature_product with the id_product and the id_feature_value. I want to get in a array all products with a feature in parameter. How can I do this ? I'm a newbie, Join SQL ? How I can do this ? Link to comment Share on other sites More sharing options...
phinq1910 Posted May 17, 2018 Share Posted May 17, 2018 You can try Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(" SELECT p.id_product FROM `'._DB_PREFIX_.'feature_product` as p LEFT JOIN `'._DB_PREFIX_.'feature_value` as f ON (f.`id_feature_value` = p.`id_feature_value`) LEFT JOIN `'._DB_PREFIX_.'feature_shop` fs ON (f.`id_feature` = fs.`id_feature`) WHERE ... ") Link to comment Share on other sites More sharing options...
Frenchy Posted May 17, 2018 Author Share Posted May 17, 2018 More simply, I have get product_id with same feature name. It is possible to create accessories product with product ID ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now