Chill_user Posted March 31, 2020 Share Posted March 31, 2020 Hello, Is it possible to create next rule: debug mode is switched on only for the admin users or customers.id? I know that define('_PS_MODE_DEV_', false); is configuration table and "false" or "true" is boolean values stored globally. My isssue about prestashop 1.7: I have some modules installed shows "dump" info only in debug mode; If debug = false, I have white page. I can't export it to the custom project because these are payment modules or something like this, so I need to debug online. Example: saferpay module. Any solutions, please? Link to comment Share on other sites More sharing options...
Knowband Plugins Posted March 31, 2020 Share Posted March 31, 2020 Instead for the admin only, You can enable the same for particular IP. Update your IP in the below code to enable to debug for specific IP only. if (!defined('_PS_MODE_DEV_')) { if ($_SERVER["REMOTE_ADDR"] == '{YOUR-IP}') { define('_PS_MODE_DEV_', true); } else { define('_PS_MODE_DEV_', false); } Link to comment Share on other sites More sharing options...
Chill_user Posted March 31, 2020 Author Share Posted March 31, 2020 1 hour ago, Knowband Plugins said: Instead for the admin only, You can enable the same for particular IP. Update your IP in the below code to enable to debug for specific IP only. if (!defined('_PS_MODE_DEV_')) { if ($_SERVER["REMOTE_ADDR"] == '{YOUR-IP}') { define('_PS_MODE_DEV_', true); } else { define('_PS_MODE_DEV_', false); } just a question: remote_addr - what is this? Thanks a lot for your help! Link to comment Share on other sites More sharing options...
Knowband Plugins Posted March 31, 2020 Share Posted March 31, 2020 $_SERVER["REMOTE_ADDR"] is find your current IP using the PHP. Search in google for your current IP OR VISIT https://whatismyipaddress.com/ if (!defined('_PS_MODE_DEV_')) { if ($_SERVER["REMOTE_ADDR"] == '45.33.33.211') { define('_PS_MODE_DEV_', true); } else { define('_PS_MODE_DEV_', false); } Link to comment Share on other sites More sharing options...
Chill_user Posted April 1, 2020 Author Share Posted April 1, 2020 15 hours ago, Knowband Plugins said: $_SERVER["REMOTE_ADDR"] is find your current IP using the PHP. Search in google for your current IP OR VISIT https://whatismyipaddress.com/ if (!defined('_PS_MODE_DEV_')) { if ($_SERVER["REMOTE_ADDR"] == '45.33.33.211') { define('_PS_MODE_DEV_', true); } else { define('_PS_MODE_DEV_', false); } Thanks a lot! Link to comment Share on other sites More sharing options...
fbenoist.com Posted April 1, 2020 Share Posted April 1, 2020 You can also use this module https://addons.prestashop.com/en/website-performance/30834-prestashop-debug-toolbar.html Link to comment Share on other sites More sharing options...
connexiocat Posted August 27, 2020 Share Posted August 27, 2020 Thanks Knowband Plugins, but due an error. .... lost the last } The correct code : if (!defined('_PS_MODE_DEV_')) { if ($_SERVER["REMOTE_ADDR"] == 'PUT HERE YOUR IP') { define('_PS_MODE_DEV_', true); } else { define('_PS_MODE_DEV_', false); } } 1 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