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

Share this post


Link to post
Share on other sites

hello, 

have you tried this file classes/Profile.php ?

Share this post


Link to post
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???

Share this post


Link to post
Share on other sites

hello,

have you checked your database if your table ps_profile has more than 4 rows? because maybe it has just 4 rows.

Share this post


Link to post
Share on other sites

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…

 

 

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

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More