fix error in osMAX shopping cart

For the past couple weeks, I have had numerous customers who placed duplicate or triplicate orders for the same items but the payment does not go thru for any of them. Orders from some people do go thru properly and payment is received. I could not duplicate the error.

Finally a customer reported he got this error:

It went through the whole process and said the payment had been recevied than the the next page said: Fatal error: Cannot redeclare class order_total in /path/to/my/hosting/catalog2/includes/classes/[url removed, login to view] on line 13

This catalog has been up for a few years and working properly. About 4 months ago I changed web hosts from a virtual account to a dedicated server, but didn't notice anything wrong until recently. I haven't changed anything other than hosting accounts.

This site runs on osMAX RC3, which is basically just osCommerce with a bunch of contributions added and a BTS templating system, which makes it harder to figure out where the relevant code is at.

I have the Paypal IPN for a Premier account installed as my processor.

Line 13 of [url removed, login to view] says:


class order_total {

var $modules;


[url removed, login to view] appears to have a modification for the Gift Voucher contribution (I give new customers a code for $5.00 off their first order, which might explain why some orders go thru and others don't) that says:




// This function is called in checkout payment after display of payment methods. It actually calls

// two credit class functions.


// use_credit_amount() is normally a checkbox used to decide whether the credit amount should be applied to reduce

// the order total. Whether this is a Gift Voucher, or discount coupon or reward points etc.


// The second function called is credit_selection(). This in the credit classes already made is usually a redeem box.

// for entering a Gift Voucher number. Note credit classes can decide whether this part is displayed depending on

// E.g. a setting in the admin section.


function credit_selection() {

$selection_string = '';

$close_string = '';

$credit_class_string = '';


$header_string = '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$header_string .= ' <tr>' . "\n";

$header_string .= ' <td class="main"><b>' . TABLE_HEADING_CREDIT . '</b></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= ' </table></td>' . "\n";

$header_string .= ' </tr>' . "\n";

$header_string .= '<tr>' . "\n";

$header_string .= ' <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">' . "\n";

$header_string .= ' <tr class="infoBoxContents"><td><table border="0" width="100%" cellspacing="0" cellpadding="2">' ."\n";

$header_string .= ' <tr><td width="10">' . tep_draw_separator('[url removed, login to view]', '10', '1') .'</td>' . "\n";

$header_string .= ' <td colspan="2"><table border="0" width="100%" cellspacing="0" cellpadding="2">' . "\n";

$close_string = ' </table></td>';

$close_string .= '<td width="10">' . tep_draw_separator('[url removed, login to view]', '10', '1') . '</td>';

$close_string .= '</tr></table></td></tr></table></td>';

$close_string .= '<tr><td width="100%">' . tep_draw_separator('[url removed, login to view]', '100%', '10') . '</td></tr>';


$output_string = '';

while (list(, $value) = each($this->modules)) {

$class = substr($value, 0, strrpos($value, '.'));

if ($GLOBALS[$class]->enabled && $GLOBALS[$class]->credit_class) {

$use_credit_string = $GLOBALS[$class]->use_credit_amount();

if ($selection_string =='') $selection_string = $GLOBALS[$class]->credit_selection();

if ( ($use_credit_string !='' ) || ($selection_string != '') ) {

$output_string .= '<tr colspan="4"><td colspan="4" width="100%">' . tep_draw_separator('[url removed, login to view]', '100%', '10') . '</td></tr>';

$output_string = ' <tr class="moduleRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" >' . "\n" .

' <td width="10">' . tep_draw_separator('[url removed, login to view]', '10', '1') .'</td>' .

' <td class="main"><b>' . $GLOBALS[$class]->header . '</b></td>' . $use_credit_string;

$output_string .= '<td width="10">' . tep_draw_separator('[url removed, login to view]', '10', '1') . '</td>';

$output_string .= ' </tr>' . "\n";

$output_string .= $selection_string;




if ($output_string != '') {

$output_string = $header_string . $output_string;

$output_string .= $close_string;



return $output_string;


// if ($selection_string !='') {

// $output_string .= '</td>' . "\n";

// $output_string .= $selection_string;

// }

// update_credit_account is called in checkout process on a per product basis. It's purpose

// is to decide whether each product in the cart should add something to a credit account.

// e.g. for the Gift Voucher it checks whether the product is a Gift voucher and then adds the amount

// to the Gift Voucher account.

// Another use would be to check if the product would give reward points and add these to the points/reward account.



I need someone to figure out what the problem is and fix it ASAP.

Kemahiran: Troli Membeli-belah

Lihat lagi: osmax shopping cart, redeclare class order_total, fix oscommerce shopping cart, wrong header, why would a paypal payment be pending, why paypal payment pending, why is payment pending in paypal, why is my paypal payment pending, why does paypal says payment pending, what is the fix, what is a virtual function, web site error, voucher discount, virtual shopping cart, this error, the fix it, return path, purpose of payment, paypal payment says pending, payment purpose, my fix it, line in problem, icw, gif reduce, fix page

Tentang Majikan:
( 18 ulasan ) Oroville, United States

ID Projek: #350765