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)
-   -   Adding my own custom PHP pages? (https://forum.x-cart.com/showthread.php?t=47093)

AgentBristow 04-22-2009 01:43 AM

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?


Victor D 04-22-2009 02:41 AM

Re: Adding my own custom PHP pages?
Also you can check pageid in pages.php before the line

$smarty->assign("page_data", $page_data);
and add extra data to $page_data variable

AgentBristow 04-22-2009 02:50 AM

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:

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


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 :(

Victor D 04-22-2009 03:00 AM

Re: Adding my own custom PHP pages?
Tha basic sheme is

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('lib3'); //loading custom x-cart libraries from include/func directory (if required)

.... // your custom code which is using x-cart libraries


AgentBristow 04-22-2009 03:16 AM

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?

natewill 02-12-2010 09:43 PM

Re: Adding my own custom PHP pages?
can somebody submit a sample page so i know how to do this..... thanks a million...:D/

All times are GMT -8. The time now is 02:29 AM.

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