Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Can't install payment modules


doron23

Recommended Posts

I want to install a payment module and go through a real transaction on my new osCommerce installation. However, when I click on Modules->Payment, no payment module is selected.

 

I don't see the option to install the Verisign module that I ftp'd nor the option to install the default ones such as ipayment or authorize.net.

 

I verified that folder have 755 permission, and files have 644 permission. So if it's not a permission problem, any ideas what the problem might be?

 

What I do see is one line: TEXT_MODULE_DIRECTORY path_to_my_store/includes/modules/payment/ and an INSTALL button on the right, but when I click that, it goes to a blank page.

Edited by doron23
Link to comment
Share on other sites

What I do see is one line: TEXT_MODULE_DIRECTORY path_to_my_store/includes/modules/payment/

Take a look at this page: admin/includes/languages/english/modules.php - Line:197

<td colspan="3" class="smallText"><?php echo TEXT_MODULE_DIRECTORY . ' ' . $module_directory; ?></td>

This is the page you are looking at in your Admin panel.

 

Check out the switch statement at the top of the page:

 

$set = (isset($HTTP_GET_VARS['set']) ? $HTTP_GET_VARS['set'] : '');

 

if (tep_not_null($set)) {

switch ($set) {

case 'shipping':

$module_type = 'shipping';

$module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';

$module_key = 'MODULE_SHIPPING_INSTALLED';

define('HEADING_TITLE', HEADING_TITLE_MODULES_SHIPPING);

break;

case 'ordertotal':

$module_type = 'order_total';

$module_directory = DIR_FS_CATALOG_MODULES . 'order_total/';

$module_key = 'MODULE_ORDER_TOTAL_INSTALLED';

define('HEADING_TITLE', HEADING_TITLE_MODULES_ORDER_TOTAL);

break;

case 'payment':

default:

$module_type = 'payment';

$module_directory = DIR_FS_CATALOG_MODULES . 'payment/';

$module_key = 'MODULE_PAYMENT_INSTALLED';

define('HEADING_TITLE', HEADING_TITLE_MODULES_PAYMENT);

break;

}

}

 

Check that the Get variable is set when you click on payment under modules in your Admin panel, you should see something like -

set=payment

in your address bar..

 

The TEXT_MODULE_DIRECTORY is a variable defined on this page: admin/includes/languages/english/modules.php (assuming the default language is english) - Line:21

 

Since it is not being interpreted then the page which defines it may not have been included, or it is not there.

The includes should all be on this page: admin/includes/application_top.php

 

Since you see a path: path_to_my_store/includes/modules/payment/ then the variable $module_directory is being interpreted.

Lloyd

Link to comment
Share on other sites

The TEXT_MODULE_DIRECTORY is a variable defined on this page: admin/includes/languages/english/modules.php (assuming the default language is english) - Line:21

 

Since it is not being interpreted then the page which defines it may not have been included, or it is not there.

The includes should all be on this page: admin/includes/application_top.php

 

Since you see a path: path_to_my_store/includes/modules/payment/ then the variable $module_directory is being interpreted.

 

TEXT_MODULE_DIRECTORY is defined under /catalog/admin/includes/languages/english/modules.php

 

application_top.php includes admin/includes/configure.php.

 

Does anyone know if there should be a setting in that configure.php which will include the TEXT_MODULE_DIRECTORY constant?

 

I see a DIR_WS_MODULES but I don't see a DIR_FS_MODULES. Could that be a problem?

Link to comment
Share on other sites

TEXT_MODULE_DIRECTORY is defined under /catalog/admin/includes/languages/english/modules.php

 

application_top.php includes admin/includes/configure.php.

 

Does anyone know if there should be a setting in that configure.php which will include the TEXT_MODULE_DIRECTORY constant?

 

I see a DIR_WS_MODULES but I don't see a DIR_FS_MODULES. Could that be a problem?

 

What I do see is one line: TEXT_MODULE_DIRECTORY path_to_my_store/includes/modules/payment/

 

The path is being set just fine (assuming that it is correct) -- (is it?)

 

This is the: path_to_my_store/includes/modules/payment/

 

The variable that is not getting set is: TEXT_MODULE_DIRECTORY

 

Why?

I dont know..

 

But this variable is not in the config file it is in: admin/includes/languages/english/modules.php

 

You said you had loaded some other payment modules,, I would start there.. Did they overwrite any pages?? Perhaps you could load those same default osC pages back -- overwriting the same..

Lloyd

Link to comment
Share on other sites

You said you had loaded some other payment modules,, I would start there.. Did they overwrite any pages?? Perhaps you could load those same default osC pages back -- overwriting the same..

 

The only 2 pages I added were for the Verisign payment module (both called verisign.php, uploaded in 2 places).

I then tried doing a clean reinstall (deleting the /catalog directory and reuploading osCommerce and going through the installation process again).

 

I know others had a similar problem and in one case it had to do with configure.php and making sure that absolute paths were set, though it appears that I'm covered there.

 

Any other ideas are welcome.

Link to comment
Share on other sites

I am noticing that the issue with some constants not showing values appears on other pages as well.. such as:

Catalog->Categories/Products. The heading at the top of that page is HEADING_TITLE, and not what it should be (presumably 'Categories/Products').

Link to comment
Share on other sites

I am noticing that the issue with some constants not showing values appears on other pages as well.. such as:

Catalog->Categories/Products. The heading at the top of that page is HEADING_TITLE, and not what it should be (presumably 'Categories/Products').

 

You might try some debugging,,

Place some echo statements on your pages then call them up and see what variables are setting.

It seems that your variables that are not setting are langauge varibales..

Check out this on application_top.php line 109

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

$current_page = basename($PHP_SELF);

if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {

include(DIR_WS_LANGUAGES . $language . '/' . $current_page);

}

 

so try an echo statement, to see if $_SESSION['languages_id'] and other variables are setting.

 

Something like:

 

echo 'sess lang id = ' . $_SESSION['languages_id'] . ' lang_id = ' . $languages_id

 

Or even better, include the echo statments in the if statements above..

 

// set the language

if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {

echo 'session language is not registered, Get Var lang = ' . $HTTP_GET_VARS['language'] . '<br>';

if (!tep_session_is_registered('language')) {

tep_session_register('language');

tep_session_register('languages_id');

echo 'session language has been registered = ' . $_SESSION['language'] . '<br>' . session lang id has been registered = ' . $_SESSION['language_id'] . '<br>';

}

 

include(DIR_WS_CLASSES . 'language.php');

$lng = new language();

 

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {

$lng->set_language($HTTP_GET_VARS['language']);

} else {

$lng->get_browser_language();

}

 

$language = $lng->language['directory'];

$languages_id = $lng->language['id'];

}

 

// include the language translations

require(DIR_WS_LANGUAGES . $language . '.php');

$current_page = basename($PHP_SELF);

if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {

include(DIR_WS_LANGUAGES . $language . '/' . $current_page);

echo 'path = ' . DIR_WS_LANGUAGES . $language . '/' . $current_page . '<br>';

}

 

Something like that..

It should print at the top of the page you open and then you can check...

 

Debug...

Lloyd

Link to comment
Share on other sites

Here's an update, in case this helps anyone else:

 

In /admin/includes/application_top.php line 137

$current_page = basename($PHP_SELF);

 

basename($PHP_SELF) did not produce anything.

I changed this to basename($_SERVER["PHP_SELF"]) and this fixed the issue of the constants not translating properly throughout the various admin pages.

 

So now, on /catalog/admin/modules.php instead of seeing:

TEXT_MODULE_DIRECTORY path_to_my_store/includes/modules/payment/ and an INSTALL button on the right, I see:

Module Directory: path_to_my_store/includes/modules/payment/ and an INSTALL button on the right.

 

I still have the issue with payment modules not showing up.

The Get variables I see set are: set=payment&selected_box=modules.

 

Looking at modules.php next..

Edited by doron23
Link to comment
Share on other sites

More progress made, and related to the previous fix:

 

on /catalog/admin/modules.php (Line 111):

Replaced: $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));

 

with the following: $file_extension = substr($_SERVER["PHP_SELF"], strrpos($_SERVER["PHP_SELF"], '.'));

 

Now I am finally actually able to see the list of payment modules available for installation.

 

I'll post again if I run into further related issues.

Link to comment
Share on other sites

Just another addition to my previous post.

 

Again, in /catalog/admin/modules.php (Line 54):

 

Replaced: $file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));

With: $file_extension = substr($_SERVER["PHP_SELF"], strrpos($_SERVER["PHP_SELF"], '.'));

 

This will allow you to actually install the selected module.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...