Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Custom script into template

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-20-2004, 01:54 PM
 
techlink techlink is offline
 

Member
  
Join Date: Jun 2004
Posts: 22
 

Default 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
Reply With Quote
  #2  
Old 08-06-2004, 02:13 PM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

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.
Reply With Quote
  #3  
Old 08-08-2004, 10:29 AM
 
Adian009 Adian009 is offline
 

Advanced Member
  
Join Date: Mar 2004
Location: Tiverton, RI, USA
Posts: 37
 

Default

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
__________________
---------------------------------------------
Infosolv, LLC
A Professional Services Company
X-Cart v3.5.10 & 4.01
Find our MOD\'s at: Custom X-Cart MOD\'s, Add-On\'s & X-Cart Hosting!
Reply With Quote
  #4  
Old 10-30-2005, 04:20 AM
 
jeeya jeeya is offline
 

X-Adept
  
Join Date: May 2003
Location: USA
Posts: 807
 

Default

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.
__________________
X-Cart Version 4.1.8
Hosted on Linux
Reply With Quote
  #5  
Old 08-01-2007, 06:25 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default 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
__________________
X-Cart Gold V 4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:48 PM.

   

 
X-Cart forums © 2001-2020