Guest LJ Munz Posted September 14, 2005 Share Posted September 14, 2005 I'm trying to integrate cubecart into a website. What I'm trying to do is call 2 external php files (header/footer) to place the shell of the site around cubecart. I attempted to figure this out on my own but to no avail so I searched the forums here and found two threads which helped me a bit.... this one & this one. So, here's what I've got so far... In /skins/.../global/cart.tpl & index.tpl I've created 2 variables, {SHELL_HEAD} & {SHELL_FOOT} in the appropriate places that I want to call the 2 external php files. In /includes/content/index.inc.php & cart.inc.php I added this... $index->assign("SHELL_HEAD",$shell_head); $index->assign("SHELL_FOOT",$shell_foot); Finally, in the /includes/global.inc.php I added this... $shell_head = require_once ("http://example.com/header.inc.php"); $shell_foot = require_once ("http://example.com/footer.inc.php"); Unfortunately, when visiting the cart, it appears that it is outputting both of the included files first, then the regular cart output after that, instead of the locations I added {SHELL_HEAD} & {SHELL_FOOT} in the .tpl files. I know I'm very close to getting this working right and it's probably something small I'm missing here but any help would be greatly apprecaited. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
roban Posted September 14, 2005 Share Posted September 14, 2005 I'm not sure why you added to global.inc.php. Would it not be better to add #SHELLHEAD & #SHELLFOOT attributes to layout.css. Quote Link to comment Share on other sites More sharing options...
Guest LJ Munz Posted September 14, 2005 Share Posted September 14, 2005 These are 2 php files with php & html which build the container for the website, not simply css. The SHELLHEAD consists of a header, navigation bar, and a left column. The SHELLFOOT makes up the right column and the footer. This would be placed around the contents of the cart. Quote Link to comment Share on other sites More sharing options...
convict Posted September 14, 2005 Share Posted September 14, 2005 In /includes/content/index.inc.php & cart.inc.php I added this... $index->assign("SHELL_HEAD",$shell_head); $index->assign("SHELL_FOOT",$shell_foot); I dont believe, that all you posted on Sep 14 2005, 08:54 PM has been worked ever, because neither of your assigned varible has been parsed never! Bad assigned into bad files!!! index.inc.php & cart.inc.php are for content only, assigned to {PAGE_CONTENT} into global templates cart.tpl & index.tpl You have to do it like that: In index.php & cart.php add this $body->assign("SHELL_HEAD",$shell_head); $body->assign("SHELL_FOOT",$shell_foot); Quote Link to comment Share on other sites More sharing options...
Guest LJ Munz Posted September 15, 2005 Share Posted September 15, 2005 Ahh, I see what you mean. That does make more sense that the variables be assigned there, not the files in the /includes/content folder. But, it still is not working properly. Let me try and better explain what is going wrong. Ok, here is an example of how I have it setup in my template files....<head> CubeCart Meta Tags, Stylesheets, etc.. </head> <body> {SHELL_HEAD} Cubecart Content, etc.. {SHELL_FOOT} </body>in comparision, below shows the order of what is actually being output....{SHELL_HEAD} {SHELL_FOOT} <head> CubeCart Meta Tags, Stylesheets, etc.. </head> <body> Cubecart Content, etc.. </body>Any suggestions? Quote Link to comment Share on other sites More sharing options...
convict Posted September 15, 2005 Share Posted September 15, 2005 Just read PM and you can forget... Use readfile instead of require_once Im blind Read carefully this :) Quote Link to comment Share on other sites More sharing options...
Guest LJ Munz Posted September 15, 2005 Share Posted September 15, 2005 I've made the change from require_once to readfile but it seems the problem is still there. I emailed the modified files. Thanks for taking the time to help! if anyone else wants to take a look...cubecart.zip Quote Link to comment Share on other sites More sharing options...
convict Posted September 16, 2005 Share Posted September 16, 2005 Yes, yes... index.php Cut $body->assign("SHELL_HEAD",$shell_head); $body->assign("SHELL_FOOT",$shell_foot); and place after $body = new XTemplate ("skins/".$config['skinDir']."/styleTemplates/global/index.tpl"); cart.php - do it like in index.php, but red marked will be cart And finally the merit of your trable (mine 2 ) use this instead of readfile global.inc.php $shell_head = join ('', file ("http://example.com/header.inc.php")); $shell_foot = join ('', file ("http://example.com/header.inc.php")); Hope this helps :o Quote Link to comment Share on other sites More sharing options...
Guest LJ Munz Posted September 16, 2005 Share Posted September 16, 2005 ahh, still no luck I don't understand the changes to the index.php & cart files... Don't you need this... $body->assign("SHELL_HEAD",$shell_head); $body->assign("SHELL_FOOT",$shell_foot); to define {SHELL_HEAD} in the tpl files as $shell_head in the global.inc.php file?? Also, the line you wanted me to add is already there (line 77 in index.php & line 66 in cart.php). Is this correct? When I made the changes to global.inc.php the header and footer files aren't being added to the final output anymore. I appreciate all your help but I might have to give up on this and move on to another cart software altogether. Right now I'm looking for a shopping cart to integrate into several websites and although I love the file structure of CubeCart (global header/footer files, template files, etc), if I cannot use php includes to easily add a website shell around cubecart, I must look for another solution. Again, thank you for taking the time to help. Quote Link to comment Share on other sites More sharing options...
convict Posted September 19, 2005 Share Posted September 19, 2005 $body->assign("SHELL_HEAD",$shell_head); $body->assign("SHELL_FOOT",$shell_foot); to define {SHELL_HEAD} in the tpl files as $shell_head in the global.inc.php file?? Also, the line you wanted me to add is already there (line 77 in index.php & line 66 in cart.php). Is this correct? Sure its necessary but in your index.php this is at the end of file (after template parse). This must be just before tempate parsing and putting it to output! When I made the changes to global.inc.php the header and footer files aren't being added to the final output anymore. Send me files again pls, it must be seen. Quote Link to comment Share on other sites More sharing options...
Guest sunshine Posted September 24, 2005 Share Posted September 24, 2005 ***DESIGN LOGIN IS POPPING UP when you access this topic EDIT: Let me rephrase that - NOT CC login but the popup window to signon to something at ***DESIGN. Fields are empty though. Quote Link to comment Share on other sites More sharing options...
Guest EverythingWeb Posted September 24, 2005 Share Posted September 24, 2005 LJ Munz, Could you please edit your post and remove the user posted image, which is trying to access the file hidden behind username/password authentication, as it will save a lot of confusion to members and visitors to the site. Many Thanks. Quote Link to comment Share on other sites More sharing options...
Guest LJ Munz Posted September 26, 2005 Share Posted September 26, 2005 sorry about that, multitaskin a little too much :rolleyes: Quote Link to comment Share on other sites More sharing options...
Guest theorbo Posted September 27, 2005 Share Posted September 27, 2005 Here's how I got the footer info from my main site into the catalog area (due to needing to credit a graphic, and wanting to show the last update): I added into layout.css and style.css the footer id info etc. from my main site stylesheet. Then I inserted the "<div id="footer"> call into siteDocs.tpl AFTER the <!-- END: a --> comment and added some whitespace below the line of site doc names. Works fine, though a simple ability to use normal php includes would of course be preferable.... 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.