dark_stranger Posted November 25, 2007 Share Posted November 25, 2007 Hi, hope someone can help. I have been creating a site (for myself) using paypal shopping vart, but i have since discovered that its not fit for purpose & therefore after much searching i have decided to use "OpenCart", but instead of using the default OpenCart shop front I want to use my exisitng site desing and was hoping that I could intergrate certain php code from OpenCart into my site. I therefore installed opencart in the root of my site & then renamed the opencart index.php & copied my site across & started coping the contents of the opencart index.php into my website index.php and was able to copy everything across apart from... // Session - require(DIR_INCLUDE . 'session.php'); $session = new session; as the session section produces the error... Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/zoapho90/public_html/index.php:9) in /home/zoapho90/public_html/include/session.php on line 22 and the below displays the default template that i dont want. // Display Template echo($template->fetch('layout.tpl')); Therefore why am i getting the above error & would my theory work by coping the opencart index.php php code into my php page & then enter php code to display products, etc? I hope that makes sense. Quote Link to comment Share on other sites More sharing options...
janim Posted November 25, 2007 Share Posted November 25, 2007 for the first error you should include session.php in top of your page like this // here the top of page <?php require(DIR_INCLUDE . 'session.php'); $session = new session; ?> . . . the rest of your page i hope that helps Quote Link to comment Share on other sites More sharing options...
dark_stranger Posted November 25, 2007 Author Share Posted November 25, 2007 Hi and thanks for a speedy response, I copied that code to the very top of the page & get... Warning: main(DIR_INCLUDEsession.php): failed to open stream: No such file or directory in /home/zoapho90/public_html/index.php on line 2 Warning: main(DIR_INCLUDEsession.php): failed to open stream: No such file or directory in /home/zoapho90/public_html/index.php on line 2 Fatal error: main(): Failed opening required 'DIR_INCLUDEsession.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/zoapho90/public_html/index.php on line 2 saying that, its strange that if the code is in the index.php for opencart is works fine, but if its in my index.php it doesnt, and the only thing diffent is that the template code isnt used. Quote Link to comment Share on other sites More sharing options...
phpSensei Posted November 25, 2007 Share Posted November 25, 2007 The session has to be started on the FIRST LINE of your page. Quote Link to comment Share on other sites More sharing options...
dark_stranger Posted November 25, 2007 Author Share Posted November 25, 2007 Hi, that worked. Thanks, Next quick question, to continue on with my original quesiton. Now i have the original php code from the opencart index.php embeded in my ondex.php, is it possible to call php commands from the application/database such a product details, catogory names, etc Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.