Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Call to undefined function: selection() ERROR. HELP PLEASE!


lomoland

Recommended Posts

Posted

Calling All,

 

I've just set up multiple shipping zones following a few hours of dredging thru' the forum for fixes. And after all that, I now get this error when I go to the 'checkout_address.php' page:

 

Fatal error: Call to undefined function: selection() in /hsphere/local/home/user/celticwhiskeyshop.com/catalog/includes/classes/shipping.php on line 40

 

I'm going completely nuts with this site, and would be forever greatful if anyone could advise me on how to fix this?

 

Thanks fellow osCommercialists.

 

Al to tha D.

 

:shock:

Posted

The fubction should be in catalog/includes/classes/payment.php:

 

    function selection() {

     $selection_array = array();



     if (is_array($this->modules)) {

       reset($this->modules);

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

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

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

           $selection = $GLOBALS[$class]->selection();

           if (is_array($selection)) $selection_array[] = $selection;

         }

       }

     }



     return $selection_array;

   }

Posted

Hi Johnson,

 

Sorry about the code. I found the code within includes/classes/payment.php and here it is. It seems OK:

 

   function selection() {

     $selection_string = '';

     if (MODULE_PAYMENT_INSTALLED) {

       reset($this->modules);

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

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

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

           $selection_string .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">' . "n" .

                                '  <tr class="payment-odd">' . "n" .

                                '    <td class="main">' . $GLOBALS[$class]->title . '</td>' . "n" .

                                '    <td align="right" class="main">';

// display radio button option if more than 1 payment module is installed

           if (tep_count_payment_modules() > 1) {

             $selection_string .= tep_draw_radio_field('payment', $GLOBALS[$class]->code);

           } else {

             $selection_string .= tep_draw_hidden_field('payment', $GLOBALS[$class]->code);

           }

           $selection_string .= ' </td>' . "n" .

                                '  </tr>' . "n" .

                                '  <tr class="payment-even">' . "n" .

                                '    <td colspan="2">';

           $selection_string .= $GLOBALS[$class]->selection();

           $selection_string .= ' </td>' . "n" .

                                '  </tr>' . "n" .

                                '</table>' . "n";

         }

       }

     }

 

     return $selection_string;

 

I looked in includes/classes/shipping and also found the selection function. Here it is:

 

// class methods

   function selection() {

     $selection_string = '';

     if (MODULE_SHIPPING_INSTALLED) {

       reset($this->modules);

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

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

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

           $selection_string .= $GLOBALS[$class]->selection();

         }

       }

       $selection_string .= tep_draw_hidden_field('shipping_quote_all', '0');

     }

 

     return $selection_string;

 

Unfortunately I'm still geting a Fatal Error. I know it must be a fairly straight forward solution, but my PHP programming expertise is fairly shabby so I'd rather not start messing around with code cos I've been burned in the past. Any ideas guys?

 

Thanks in advance,

Al to tha D.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...