Jump to content

Site Integration


Guest LJ Munz

Recommended Posts

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!

Link to comment
Share on other sites

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.

shell.jpg

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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 :lol: ) use this instead of readfile :cry:

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

Link to comment
Share on other sites

ahh, still no luck :lol:

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. :cry:

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.

Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

Guest sunshine

***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.

Link to comment
Share on other sites

Guest EverythingWeb

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.

Link to comment
Share on other sites

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....

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

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...