Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

help with fedex web services


Guest

Recommended Posts

I am having a problem with this add-on when a customer tries to pay for an order via paypal they get this error

Fatal error: Cannot redeclare cmp() (previously declared in /home2/techsonh/public_html/includes/modules/shipping/fedexwebservices.php:225) in /home2/techsonh/public_html/includes/modules/shipping/fedexwebservices.php on line 225

 

paypal and fedex said its not them so I need to see if I can get this fixed

 

any help appreciated thanks

Link to comment
Share on other sites

  • 4 months later...

post the code of fedexwebservices.php on line 225, please?

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

Line 225 starts here:

 

function cmp($a, $B) {
  if ($a['cost'] == $b['cost']) {
 return 0;
  }
  return ($a['cost'] < $b['cost']) ? -1 : 1;
 }  

 usort($methods, 'cmp');

 

I tested and turns out that this error only occurs when using Paypal Express payment module with it. After the users selects shipping, they are sent to paypal to log in. This error shows up when paypal sends them back to checkout.

Link to comment
Share on other sites

why:

function cmp($a, $B ) {

 

as it should be:

function cmp($a, $b ) {

 

you have the issue that the cmp() function is declared twice, as for the rest of code is fine, looking on example from the php.net and comparing to the following code:

<?php
function cmp($a, $b )
{
if ($a == $b {
	return 0;
}
return ($a < $b ? -1 : 1;
}
$a = array(3, 2, 5, 6, 1);
usort($a, "cmp");
foreach ($a as $key => $value) {
echo "$key: $value\n";
}
?>

http://php.net/manua...ction.usort.php

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

  • 3 months later...
  • 1 year later...

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