AleMac Posted August 30, 2019 Share Posted August 30, 2019 Olá! Sou desenvolvedor, tenho algum conhecimento em MVC, mysql, etc. Sou novo no Prestashop e estou realmente quebrando a cabeça para fazer uma mudança simples. Eu estou tentando mudar uma query que devolve os PROFILES para os administradores. Alguém pode confirmar para mim, AONDE fica esse arquivo, da query, que LISTA os nomes dos PROFILES? (superadmin, admin, etc)? Muito obrigado! Alexandre Link to comment Share on other sites More sharing options...
ApoA Posted August 30, 2019 Share Posted August 30, 2019 hello, have you tried this file classes/Profile.php ? Link to comment Share on other sites More sharing options...
AleMac Posted August 30, 2019 Author Share Posted August 30, 2019 yes! this is (one of) original function on classes/Profile.php. the bold is what i want to add public static function getProfiles($idLang) { return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT p.`id_profile`, `name` FROM `' . _DB_PREFIX_ . 'profile` p LEFT JOIN `' . _DB_PREFIX_ . 'profile_lang` pl ON (p.`id_profile` = pl.`id_profile` AND `id_lang` = ' . (int) $idLang . ') WHERE p.`id_profile` = 1 and p.`id_shop`=1 ORDER BY `id_profile` ASC'); } but nothing changes at all! the final result is allways the same. the same 4 rows on profile (and profile_lang) tables (yes, i added an "id_shop" on profile table, and also put some value on that column) It's not cache… (i hope), it's not server's cache, browser's cache… what i'm doing wrong??? Link to comment Share on other sites More sharing options...
ApoA Posted August 30, 2019 Share Posted August 30, 2019 hello, have you checked your database if your table ps_profile has more than 4 rows? because maybe it has just 4 rows. Link to comment Share on other sites More sharing options...
AleMac Posted August 30, 2019 Author Share Posted August 30, 2019 That's my actual table bellow. With the above query, i should see only 2 rows, but i'm still getting 4! It's like the system is cached or reading from another query location… Link to comment Share on other sites More sharing options...
ApoA Posted August 30, 2019 Share Posted August 30, 2019 hello, i'm out of ideas, i'm just a beginner at php, maybe you can take if from here, i found this file /src/PrestaShopBundle/Controller/Admin/Configure/AdvancedParameters/ProfileController.php in the method "indexAction()" it return some data, and i suspect the profiles are fetched on the 'grid' index of the return array. from there i tried getting where it came from and i had nothing. Link to comment Share on other sites More sharing options...
AleMac Posted August 30, 2019 Author Share Posted August 30, 2019 look at my code (for debugging) , the query, and the results. As you can see, the QUERY here, is different from the classes/Profile.php file. That's why i'm sure it's on a different file. On this file (/src/PrestaShopBundle/Controller/Admin/Configure/AdvancedParameters/ProfileController.php) it's INNER JOIN On classes/Profile.php file, is LEFT JOIN Anyone can help? Where is the query that return the values of …/index.php/configure/advanced/profiles? 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