X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Custom script into template (https://forum.x-cart.com/showthread.php?t=8560)

techlink 07-20-2004 01:54 PM

Custom script into template
 
Im wondering if there is code I can insert at the top of each of my custom script pages so it includes the stores template and my scripts output and everything gets posted in the conent area?

Is there like an include header and footer?

Thanks Jordan

Jon 08-06-2004 02:13 PM

You can create a php file and smarty template to include a page exactly like the other pages of the cart, and then include your php into the smarty template using something like:

{php}
include "./folder/file.php";
{/php}

Not ideal, but with some tweaking it should work.

Adian009 08-08-2004 10:29 AM

Quote:

Im wondering if there is code I can insert at the top of each of my custom script pages so it includes the stores template and my scripts output and everything gets posted in the conent area?

Is there like an include header and footer?

Thanks Jordan

Jordan:

Let me explain something about your approach first..you don't need to add the "stores templates" to your pages, you need to integrate your pages into X-Cart. It is quite easy, actually, once you understand the architecture....

All you do is add your program to the /xcart/skin1/customer/home_mail.tpl file and it will include it in the "Content" area. That file is used to do *exactly* what you are trying to do. Then, in your PHP file you set "main" to the value you used in the "home_main.tpl" file. Let me show you a live example of something I wrote, below:

In my PHP file I have:

$smarty->assign("main","infosolv_shipping");
$smarty->display("customer/home.tpl");

In my home_main.tpl I have (you can ignore the comment, I put it there so I know why I modified the files):

{* 08/2004 by Al Ponte: Modified to support Infosolv Shipping. *}
{elseif $main eq "infosolv_shipping"}
{include file="customer/infosolv_shipping.tpl"}

This passes the application through the X-Cart framework and your template will be parsed as part of the overall store.

Let me know if you need more help...

--al

jeeya 10-30-2005 04:20 AM

hello, I am trying to include plogger.org - image gallery script in static page but can't seem to work. I have script in different folder / outside xcart folder.

need to place following codes. Tried few different ways but it doesn't seem to be working.

First line of HTML file -> <?php require("gallery.php"); ?>
In HEAD section of HTML -> <?php the_gallery_head(); ?>
Somewhere in BODY section -> <?php the_gallery(); ?>

I tried different path putting plogger folder name in front and few changes but doesn't work.

Is it compatible? Thanks.

Paulw 08-01-2007 06:25 AM

Re: Custom script into template
 
Quote:

Originally Posted by raxitpatel
hello, I am trying to include plogger.org - image gallery script in static page but can't seem to work. I have script in different folder / outside xcart folder.

need to place following codes. Tried few different ways but it doesn't seem to be working.

First line of HTML file -> <?php require("gallery.php"); ?>
In HEAD section of HTML -> <?php the_gallery_head(); ?>
Somewhere in BODY section -> <?php the_gallery(); ?>

I tried different path putting plogger folder name in front and few changes but doesn't work.

Is it compatible? Thanks.


Did you ever manage to intergrate Plogger? I'm trying to do the exact same thing, and it's driving me mad!

Thanks
Paul


All times are GMT -8. The time now is 07:46 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.