Jump to content

Recommended Posts

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

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

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

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?

 

 

Screen Shot 2019-08-30 at 8.08.21 AM.JPG

Screen Shot 2019-08-30 at 8.10.00 AM.JPG

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...