Forums / General Questions / using zencart from another page below cart directory

using zencart from another page below cart directory

Locked
Results 1 to 8 of 8
This thread is locked. New replies are disabled.
20 Apr 2007, 15:43
#1
ryanf avatar

ryanf

New Zenner

Join Date:
Mar 2007
Posts:
32
Plugin Contributions:
0

using zencart from another page below cart directory

Hello, I have a problem. I have my cart installed in mysite.com/products/
I want to have a featured product get displayed on my main page at mysite.com/index.php

I have tried including application_top to set everything up but I got a lot of errors about files not found. So I added set_include_path('full_server_path/products'); at the beginning. This works to get rid some of the errors so for the rest I hard coded a few directory paths and changed the DIR_WS_INCLUDES value in includes/configure. This got rid of the rest of the errors in application_top but now I am getting errors about Fatal error: Cannot instantiate non-existent class: notifier in /server_path/products/includes/autoload_func.php on line 80

Has anyone done this before? What else do I need be doing?

Thanks for the help.
20 Apr 2007, 18:04
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Posts:
21,876
Plugin Contributions:
6

Re: using zencart from another page below cart directory

I have a feeling you're setting yourself up for unending headaches doing it that way.
There have been discussions about displaying a sidebox outside of ZC; search for things like that and you should get some good pointers.
20 Apr 2007, 18:32
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: using zencart from another page below cart directory

There is a sidebox add-on, if I am not mistaken, in the downloads ... for outside the immediate site that you can probably incorporate the logic for your index.php on your root directory so that things run right ...
20 Apr 2007, 19:01
#4
ryanf avatar

ryanf

New Zenner

Join Date:
Mar 2007
Posts:
32
Plugin Contributions:
0

Re: using zencart from another page below cart directory

Thanks for the help, I found the module under "Other Modules" it was called "Show a sidebox on external page" I'll take a look to see whats being done and update on my status.


* Well it doesn't really help, it assumes the page is in the same directory as zencart I guess.
20 Apr 2007, 19:11
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Posts:
62,757
Plugin Contributions:
1

Re: using zencart from another page below cart directory

hmm ... not looked at it for a long time but I was thinking it was smarter to know "you are here" and "Zen Cart" is there ...
20 Apr 2007, 19:25
#6
ryanf avatar

ryanf

New Zenner

Join Date:
Mar 2007
Posts:
32
Plugin Contributions:
0

Re: using zencart from another page below cart directory

Well I have been modifying application_top.php and it still works when I view the page from the regular zencart directory so that is good. When I include it from a directory below the zencart page I get the error:

Fatal error: Call to a member function on a non-object in /var/www/vhosts/optimumnutrition-v2.com/httpdocs/products/includes/classes/currencies.php on line 31

Here is my modified application_top.php:

DIR_FS_CATALOG is the full server path to the products directory as set in configure.php
[PHP]
<?php
/**
* boolean if true the autoloader scripts will be parsed and their output shown. For debugging purposes only.
*/
define('DEBUG_AUTOLOAD', false);
/**
* boolean used to see if we are in the admin script, obviously set to false here.
*/
define('IS_ADMIN_FLAG', false);
/**
* integer saves the time at which the script started.
*/
define('PAGE_PARSE_START_TIME', microtime());
// define('DISPLAY_PAGE_PARSE_TIME', 'true');
@ini_set("arg_separator.output","&");

/**
* set the level of error reporting
*
* Note STRICT_ERROR_REPORTING should never be set to true on a production site. <br />
* It is mainly there to show php warnings during testing/bug fixing phases.<br />
* note for strict error reporting we also turn on show_errors as this may be disabled<br />
* in php.ini. Otherwise we respect the php.ini setting
*
*/
if (defined('STRICT_ERROR_REPORTING') && STRICT_ERROR_REPORTING == true) {
@ini_set('display_errors', '1');
error_reporting(E_ALL);
} else {
error_reporting(E_ALL & ~E_NOTICE);
}
/**
* include server parameters
*/
if (file_exists('/var/www/vhosts/optimumnutrition-v2.com/httpdocs/products/includes/configure.php')) {
/**
* load the main configure file.
*/
include('includes/configure.php');
} else {
header('location: zc_install/index.php');
}
/**
* if main configure file doesn't contain valid info (ie: is dummy or doesn't match filestructure, goto installer)
*/
if (!is_dir(DIR_FS_CATALOG.'includes/classes')) header('location: zc_install/index.php');
/**
* include the list of extra configure files
*/
if ($za_dir = @dir(DIR_FS_CATALOG . 'includes/extra_configures')) {
while ($zv_file = $za_dir->read()) {
if (preg_match('/\.php$/', $zv_file) > 0) {
/**
* load any user/contribution specific configuration files.
*/
include(DIR_WS_INCLUDES . 'extra_configures/' . $zv_file);
}
}
}
$autoLoadConfig = array();
$loader_file = 'config.core.php';
$base_dir = DIR_WS_INCLUDES . 'auto_loaders/';
if (file_exists(DIR_FS_CATALOG.'includes/auto_loaders/overrides/' . $loader_file)) {
$base_dir = DIR_WS_INCLUDES . 'auto_loaders/overrides/';
}
/**
* load the default application_top autoloader file.
*/
include($base_dir . $loader_file);

if ($loader_dir = dir(DIR_FS_CATALOG . 'includes/auto_loaders')) {
while ($loader_file = $loader_dir->read()) {
if ((preg_match('/^config\./', $loader_file) > 0) && (preg_match('/\.php$/', $loader_file) > 0)) {
if ($loader_file != 'config.core.php') {
$base_dir = DIR_WS_INCLUDES . 'auto_loaders/';
if (file_exists(DIR_FS_CATALOG . 'includes/auto_loaders/overrides/' . $loader_file)) {
$base_dir = DIR_WS_INCLUDES . 'auto_loaders/overrides/';
}
/**
* load the application_top autoloader files.
*/
include($base_dir . $loader_file);
}
}
}
}


/**
* load the autoloader interpreter code.
*/
include('includes/autoload_func.php');

/**
* load the counter code
**/
// counter and counter history
include(DIR_WS_INCLUDES . 'counter.php');

// get customers unique IP that paypal does not touch
$customers_ip_address = $_SERVER['REMOTE_ADDR'];
if (!isset($_SESSION['customers_ip_address'])) {
$_SESSION['customers_ip_address'] = $customers_ip_address;
}
?>
[/PHP]

I have changed all the is_dir checks and if file checks to use the full server path and not the relative path.

In my index.php page which is below the zc directory of products I set the include path, then include application_top then restore the path.

[PHP]
set_include_path('/var/www/vhosts/optimumnutrition-v2.com/httpdocs/products/');
require('includes/application_top.php');
restore_include_path();
[/PHP]

Any ideas on what to do next? Have I missed something obvious?
20 Apr 2007, 19:36
#7
ryanf avatar

ryanf

New Zenner

Join Date:
Mar 2007
Posts:
32
Plugin Contributions:
0

Re: using zencart from another page below cart directory

Well I fixed the last problem by changing the same type of thing with the is dir checks in autoload_func.php and one line in init_includes/init_sessions.php for the spiders file but now I get :

[PHP]
1146 Table 'on_zen.TABLE_SEO_CACHE' doesn't exist
in:
[DELETE FROM TABLE_SEO_CACHE WHERE cache_expires <= '2007-04-20 15:33:20']
[/PHP]


which I don't get. FYI, my zc installation is still working as expected so I think I'm getting close.
20 Apr 2007, 20:22
#8
ryanf avatar

ryanf

New Zenner

Join Date:
Mar 2007
Posts:
32
Plugin Contributions:
0

Re: using zencart from another page below cart directory

well, im a big dummy. I don't know why I didn't do this earlier and saved myself a big headache. I just created my own database connection to zencart and got the required information from it that way. Done in 10 minutes as opposed to the couple hours I was spending on it.

Sometimes the simpliest ways are the hardest to figure out I guess.

Thanks for the help anyways.