Guest Posted March 9, 2008 Share Posted March 9, 2008 I installed the Individual Shipping Price contribution, but I keep getting a blank page except for this at the top left corner "  " When I check the error log with my server this is what it says: PHP Fatal error: Call to undefined method: shipping->get_shiptotal() in /............/public_html/oscommerce_store/catalog/includes/modules/shipping/indvship.php on line 53 class indvship { var $code, $title, $description, $icon, $enabled, $shiptotal; // class constructor function indvship() { global $order; $this->code = 'indvship'; $this->title = MODULE_SHIPPING_INDVSHIP_TEXT_TITLE; $this->description = MODULE_SHIPPING_INDVSHIP_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_INDVSHIP_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_INDVSHIP_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_INDVSHIP_STATUS == 'True') ? true : false); // Enable Individual Shipping Module // $this->enabled = MODULE_SHIPPING_INDVSHIP_STATUS; if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_INDVSHIP_ZONE > 0) ) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_INDVSHIP_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) { $check_flag = true; break; } elseif ($check['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } } if ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order, $cart, $shipping_modules; $shiptotal = $shipping_modules->get_shiptotal(); $indvcount = $shipping_modules->get_indvcount(); if (tep_not_null($shiptotal) || tep_not_null($indvcount) || $shiptotal == '0'){ $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_INDVSHIP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_INDVSHIP_TEXT_WAY, 'cost' => $shiptotal))); if ($this->tax_class > 0) { $this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title); } return $this->quotes; } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_INDVSHIP_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } function install() { tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Individual Shipping Prices', 'MODULE_SHIPPING_INDVSHIP_STATUS', 'True', 'Do you want to offer individual shipping prices?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_INDVSHIP_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_INDVSHIP_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_INDVSHIP_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_INDVSHIP_STATUS', 'MODULE_SHIPPING_INDVSHIP_TAX_CLASS', 'MODULE_SHIPPING_INDVSHIP_ZONE', 'MODULE_SHIPPING_INDVSHIP_SORT_ORDER'); } } ?> My problem is that I don't know what it means or how to repair it. THank you, Paul Quote Link to comment Share on other sites More sharing options...
satish Posted March 9, 2008 Share Posted March 9, 2008 open page. At top You have <?php before this there are some invisible chars. Try a different editor and You might be able to see. try editplus. Even if its not visible assume something is there so delete by back space the whole of first line and retype<?php .... Satish Quote Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site. Check My About US For who am I and what My company does. Link to comment Share on other sites More sharing options...
Guest Posted March 9, 2008 Share Posted March 9, 2008 open page.At top You have <?php before this there are some invisible chars. Try a different editor and You might be able to see. try editplus. Even if its not visible assume something is there so delete by back space the whole of first line and retype<?php .... Satish Thank you for your reply. I downloaded editplus and tried it.... your suggestion didn't clear up my problem, so I checked my error logs again. I am noticed after refreshing that I have a total of 3 errors when I am in the shopping cart and click on 'checkout'. PHP Fatal error: Call to undefined function: get_shiptotal() in /.../public_html/oscommerce_store/includes/modules/shipping/indvship.php on line 53 PHP Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /.../public_html/oscommerce_store/includes/classes/shipping.php on line 68 PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /.../public_html/oscommerce_store/includes/classes/shipping.php on line 33 I also deleted the blank line at the end of each file. And I still have the same errors. Any other suggestion? Thanks, Paul Quote Link to comment Share on other sites More sharing options...
carolannjo Posted March 12, 2008 Share Posted March 12, 2008 (edited) I am getting the same error as Paul since installing the indvship module. When I go to checkout-shipping page, I get the error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/creative/public_html/includes/classes/shipping.php on line 33 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/creative/public_html/includes/classes/shipping.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/creative/public_html/includes/classes/shipping.php on line 68 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/creative/public_html/includes/classes/shipping.php on line 68 I have looked through the documentation and nothing speaks to this. However, I am puzzeled by an instruction to remove some code which has also been mentioned in the Forum. I don't have this code and am curious why or if it affects this module. The text follows: Remove the following code (unless you are using the ship method from another contibution) in: catalog / admin / categories.php //Product shipping $ship_method_array = array(array('id' => '', 'text' => TEXT_NONE)); $ship_method_query = tep_db_query("select methods_id, methods_name from " . TABLE_SHIPPING_METHODS); while ($ship_method = tep_db_fetch_array($ship_method_query)) { $ship_method_array[] = array('id' => $ship_method['methods_id'], 'text' => $ship_method['methods_name']); } //end Product shipping Is this just from another module and not needed for this module? Any help for the mysql error will be greatly appreciated. I am using osC 2.2.2 and have several other modules installed and wanted to try this because I can't get USPSMethods to work properly. Carol Ann I just wanted to add that line 33 (to follow) does not appear to have been changed from my previous shipping.php file. So I'm guessing the problem is with the SQL provided: $include_modules[] = array('class' => substr($module['id'], 0, strpos($module['id'], '_')), 'file' => substr($module['id'], 0, strpos($module['id'], '_')) . '.' . substr($PHP_SELF, (strrpos($PHP_SELF, '.')+1))); Any idea? Edited March 12, 2008 by carolannjo Quote Link to comment Share on other sites More sharing options...
shana.jk Posted April 14, 2008 Share Posted April 14, 2008 I have an error similar to this... I have posted for help but nothing yet. ( http://www.oscommerce.com/forums/index.php?sho...p;#entry1234962 ) Quote Link to comment Share on other sites More sharing options...
tomato456 Posted March 12, 2009 Share Posted March 12, 2009 I have an error similar to this... I have posted for help but nothing yet.( http://www.oscommerce.com/forums/index.php?sho...p;#entry1234962 ) I had this problem, and it was solved by uploading the modified file catalog / includes / classes / shipping.php apparently I had not uploaded it or uploaded it to the wrong location. I had had to edit all the files in the Individual Shipping mod by hand because I had modified my install a lot, which can lead to stupid errors. I had another problem that was solved simply by making sure all the edited files had been uploaded to the proper place. Quote Link to comment Share on other sites More sharing options...
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.