Guest Posted August 8, 2011 Posted August 8, 2011 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 Quote
web-project Posted December 9, 2011 Posted December 9, 2011 post the code of fedexwebservices.php on line 225, please? Quote 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.
ckpepper02 Posted December 10, 2011 Posted December 10, 2011 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. Quote
web-project Posted December 10, 2011 Posted December 10, 2011 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 Quote 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.
ckpepper02 Posted December 10, 2011 Posted December 10, 2011 I don't know why the code pasted in with a captial '$B', but it's a '$b' in the code as well. Quote
ckpepper02 Posted December 12, 2011 Posted December 12, 2011 Still have not fixed the issue. But I did see that the cmp function was wrapped inside a foreach method. Tried moving it outside of that foreach and I got the same error on a different line. So no real progress here. Quote
jerrygarciuh Posted March 28, 2012 Posted March 28, 2012 (edited) This can be fixed like so: if (!function_exists('cmp')) { function cmp($a, $B) { if ($a['cost'] == $b['cost']) { return 0; } return ($a['cost'] < $b['cost']) ? -1 : 1; } } Edited March 28, 2012 by jerrygarciuh Quote
bluegrassinstalls Posted September 10, 2013 Posted September 10, 2013 how can i determine the line numbers? Fatal error: Cannot redeclare class fedexwebservices in /hermes/waloraweb072/b1566/as.amchisal/public_html/djcdist.com/includes/modules/shipping/fedexwebservices.php on line 9 Quote
Recommended Posts
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.