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

Adding my own custom PHP pages?

 
Reply
   X-Cart forums > X-Cart 4 > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-22-2009, 01:43 AM
 
AgentBristow AgentBristow is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 36
 

Default Adding my own custom PHP pages?

I know how to add static pages in the x-cart admin, but I have pre designed PHP pages with the site content that I want to use within the x-cart framework - is it possible to create these somehow?

Thanks!
__________________
Xcart Version 4.1.9 [win]
Reply With Quote
  #2  
Old 04-22-2009, 02:41 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Adding my own custom PHP pages?

http://forum.x-cart.com/showthread.php?t=46954&highlight=auth.php
Also you can check pageid in pages.php before the line
Code:
$smarty->assign("page_data", $page_data);
and add extra data to $page_data variable
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #3  
Old 04-22-2009, 02:50 AM
 
AgentBristow AgentBristow is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 36
 

Default Re: Adding my own custom PHP pages?

Thanks for that. I checked out the link and it told me I needed to add this to my code:

require_once 'auth.php';

So I added it as below but got the following errors:


<?php
require_once "/clientdata/clients/d/a/mywebsite.com/www/cms/lib/viewer_functions.php";

list($aboutRecords, $aboutMetaData) = getRecords(array(
'tableName' => 'about',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$aboutRecord = @$aboutRecords[0]; // get first record

require_once 'auth.php';

?>


ERRORS >
Warning: require_once(auth.php): failed to open stream: No such file or directory in /clientdata/clients/d/a/mywebsite.com/www/about_test.php on line 12 Fatal error: require_once(): Failed opening required 'auth.php' (include_path='/clientdata/clients/d/a/mywebsite.com/www/cms:.:/clientdata/php/php5/lib/php:/clientdata/php/lib') in /clientdata/clients/d/a/mywebsite.com/www/about_test.php on line 12


what have I done wrong? I tried to put the page in the x-cart directory (shop) but it still didn't work
__________________
Xcart Version 4.1.9 [win]
Reply With Quote
  #4  
Old 04-22-2009, 03:00 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: Adding my own custom PHP pages?

Tha basic sheme is
Code:
require_once ... ; // your custom includes and requres here .... // your custom code which is not using x-cart libraries (can be omited) chdir( realpath('../shop/').'/'); //changing current directory to x-cart directory (shop in your case) require_once('auth.php'); // including x-cart core libraries x_load('lib1'); x_load('lib2'); ... x_load('lib3'); //loading custom x-cart libraries from include/func directory (if required) .... // your custom code which is using x-cart libraries

http://forum.x-cart.com/showpost.php?p=255489&postcount=3
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #5  
Old 04-22-2009, 03:16 AM
 
AgentBristow AgentBristow is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 36
 

Default Re: Adding my own custom PHP pages?

Thank you for posting the link again which I already read, but I do not understand what I am supposed to do. I made a file called class.Test.php and put that code in the top of my PHP page yet I am still getting the same error as per above?
__________________
Xcart Version 4.1.9 [win]
Reply With Quote
  #6  
Old 02-12-2010, 09:43 PM
 
natewill natewill is offline
 

Newbie
  
Join Date: Jan 2010
Posts: 8
 

Red face Re: Adding my own custom PHP pages?

can somebody submit a sample page so i know how to do this..... thanks a million...
__________________
4.3
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > 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 03:41 PM.

   

 
X-Cart forums © 2001-2020