Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_get_order_status_name function error - Paypal IPN


Recommended Posts

Posted

This error occurred for me with Preview Release 2.2-CVS, since I added the Paypal IPN .971 overwrite and run:

 

Warning: call_user_func() expects first argument, 'tep_get_order_status_name', to be a valid callback in /home/sites/www.perfumeparadise.ca/web/catalog/admin/includes/functions/general.php on line 1232

 

 

In admin/includes/functions/general.php the function that this is trying to call is tep_get_orders_status_name, but in the error listed here and the error I am getting it say: 'tep_get_order_status_name'

 

So the question is, what file is calling this function with the wrong name? I am looking, but I can't find it.

Posted

I searched with AgentRansack and there are several references to tep_get_order_status_name. The one in includes/modules/payment/paypal.php is inside of a tep_db_query which I assume is why it is called a callback.

In olden times the men were made of iron and the ships were made of wood; now it's the other way around. :wink:

Posted

Well, since I am talking about the paypalipn function the paypal.php does not apply. But you did send me in the right direction and I found what I was looking for.

 

In includes/modules/payments/paypalipn.php

 

Change this:

 

# tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '14', 'tep_cfg_pull_down_order_statuses(', 'tep_get_order_status_name', now())");

 

To this:

 

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_PAYPALIPN_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '14', 'tep_cfg_pull_down_order_statuses(', 'tep_get_orders_status_name', now())");

 

The only difference is that tep_get_order_status_name becomes tep_get_orders_status_name. This is the correct name of the function

 

The error has now disappeared. Please note that I had to disable and then enable paypalIPN, for it to take effect.

Posted

Now that we solved that, when you click on the Edit button for the Paypal IPN module you get this error:

 

Fatal error: Call to undefined function: tep_cfg_pull_down_order_statuses() in /home/drytush/public_html/store/admin/modules.php(204) : eval()'d code on line 1

 

So now we have to find out why tep_cfg_pull_down_order_statuses is undefined.

Posted

This is so weird. I have one store with 2.2-MS1 where the function called in paypalipn.php is order without the s and that one works fine. Except that one is having problems with the IPN test.

 

Then I have a store that is Preview release 2.2-CVS and that is the one which had the problems discussed in this thread and the error was corrected with the change in the code I listed above.

 

Both stores have IPN .971 installed.

 

I can't figure this out. So strange.

Posted

I used your fix and got rid of the one error code! woo hoo, but I too get that second error when I click the edit.

 

Terri

Help me I'm lost in PHP and I don't have a map!

Posted

Ok I found it. admin/includes/functions/general.php is missing the following code. This applies to the 2.2-CVS that is installed by cpanel6.

 

Insert around line 1250, after this:

 

return $classes['geo_zone_name'];

}

}

 

  function tep_cfg_pull_down_order_statuses($order_status_id, $key = '') {

   global $languages_id;



   $name = (($key) ? 'configuration[' . $key . ']' : 'configuration_value');



   $statuses_array = array(array('id' => '0', 'text' => TEXT_DEFAULT));

   $statuses_query = tep_db_query("select orders_status_id, orders_status_name from " . TABLE_ORDERS_STATUS . " where language_id = '" . $languages_id . "' order by orders_status_name");

   while ($statuses = tep_db_fetch_array($statuses_query)) {

     $statuses_array[] = array('id' => $statuses['orders_status_id'],

                               'text' => $statuses['orders_status_name']);

   }



   return tep_draw_pull_down_menu($name, $statuses_array, $order_status_id);

 }



 function tep_get_order_status_name($order_status_id, $language_id = '') {

   global $languages_id;



   if ($order_status_id < 1) return TEXT_DEFAULT;



   if (!is_numeric($language_id)) $language_id = $languages_id;



   $status_query = tep_db_query("select orders_status_name from " . TABLE_ORDERS_STATUS . " where orders_status_id = '" . $order_status_id . "' and language_id = '" . $language_id . "'");

   $status = tep_db_fetch_array($status_query);



   return $status['orders_status_name'];

 }

 

and before this:

////

// Return a random value

Posted

This also explains the discrepency with the get_order_status_name. This function is included here. So, I am not sure what to do about that.

 

I will let you know.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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...