dinobigioni Posted March 21, 2016 Share Posted March 21, 2016 (edited) I want to write a simple script which uses Prestashop core class. I wrote this bunch of code <?php ini_set('display_errors','On'); error_reporting(E_ALL ^ E_NOTICE); set_time_limit(0); include(dirname(__FILE__).'/prestashop/config/config.inc.php'); include(dirname(__FILE__) . '/prestashop/init.php'); phpinfo(); ?> When i try it, i'm redirected to my store index page. What's wrong? Thanks in advance. PS: my script is in wwwroot and prestashop in wwwroot/prestashop folder Edited March 21, 2016 by dinobigioni (see edit history) Link to comment Share on other sites More sharing options...
presta.show Posted March 21, 2016 Share Posted March 21, 2016 do you have .htaccess file in your script directory? Link to comment Share on other sites More sharing options...
dinobigioni Posted March 22, 2016 Author Share Posted March 22, 2016 No. There isn't. Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 When you includes config.inc.php it's executes Shop::initialize() which redirects you to shop url. You can add ?id_shop=1 to your url to prevent redirection eg: http://localhost/test.php?id_shop=1 Link to comment Share on other sites More sharing options...
Mecadisc Posted March 22, 2016 Share Posted March 22, 2016 (edited) Hi, how to use header and footer of our Prestashop template from external php file please ? for now i have : require($_SERVER["DOCUMENT_ROOT"]."/header.php"); ErShow(); echo $TDMContent; require($_SERVER["DOCUMENT_ROOT"]."/footer.php"); i have a custom php file. thanks for your help. Edited March 22, 2016 by Mecadisc (see edit history) Link to comment Share on other sites More sharing options...
presta.show Posted March 22, 2016 Share Posted March 22, 2016 <?php global $smarty; global $cookie; include(dirname(__FILE__).'/shop/config/config.inc.php'); include(dirname(__FILE__).'/shop/header.php'); // your code here include(dirname(__FILE__).'/shop/footer.php'); 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