Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Warning: Division by zero


milkman45

Recommended Posts

Hi Guys,

 

Its been some time that i have required any ones help. I've found the 2.3.4 very robust and included the MINI TEMPLATE SYSTEM to make my site as required with no real issues en-counted.

 

This time out though i have no idea what has happened but i need some help !!!!!!!!

 

 

At the "http://rabhobbies.com.au/online/checkout_shipping.php"page when a customer is ready to proceed further he/she receives this error message.

Warning: Division by zero in /home16/rabhobbi/public_html/online/includes/classes/shipping.php on line 87

Warning: Division by zero in /home16/rabhobbi/public_html/online/includes/classes/shipping.php on line 88

Warning: Cannot modify header information - headers already sent by (output started at /home16/rabhobbi/public_html/online/includes/classes/shipping.php:87) in /home16/rabhobbi/public_html/online/includes/functions/general.php on line 49

 

I've also noticed that the "Shipping / Packaging" window in "admin/configuration.php" is blank !!

 

I presume this is the cause but am stumped as to how to fix. !!

 

Any help would be great as this has stopped customers finalising any online purchases.

 

Regards,

 

Ren.

 

post-155575-0-78063000-1481751962_thumb.jpg

Link to comment
Share on other sites

@@milkman45

 

Once you find the cause of the blank page in Shipping / Packaging, the Warning: Division by zero may go away. It can't calculate or divide what's not there. As is your page is blank, therefore it's at 0 and you can't divide 0.

 

Look in your errors.log file. The cause of the blank page may show in there. The Warning: Cannot modify header information is a secondary error caused by the first error. That should go away as well once you find the cause of the blank page.

 

Take care

Bill

Link to comment
Share on other sites

No , not at all.

 

The only new module was a new payment module but there was no modification of any core file. Just upload and configure and upload the SQL file for the module. 

 

The site was working fine up until late last night which is when i noticed the ERROR.

Link to comment
Share on other sites

@@milkman45

 

Once you find the cause of the blank page in Shipping / Packaging, the Warning: Division by zero may go away. It can't calculate or divide what's not there. As is your page is blank, therefore it's at 0 and you can't divide 0.

 

Look in your errors.log file. The cause of the blank page may show in there. The Warning: Cannot modify header information is a secondary error caused by the first error. That should go away as well once you find the cause of the blank page.

 

Take care

Bill

 

Hi Bill.

 

 

Just had a look at the errors.log and nothing there in the last two days !!!! 

 

Thats got me now.

Link to comment
Share on other sites

@@milkman45

 

If you checked both errors.log files and there's nothing there then you can look in your database. The text for that page is in your database. Once your in there click on the Search tab. Once it open up go to configuration_key. Click the drop down arrow and select LIKE%...%.  Then type the word SHIPPING in all capitol letters. Click go or enter and then you'll be able to see if the text for that page is there or has been wiped out for some reason.

 

Take care

Bill

Link to comment
Share on other sites

@@milkman45

 

If you checked both errors.log files and there's nothing there then you can look in your database. The text for that page is in your database. Once your in there click on the Search tab. Once it open up go to configuration_key. Click the drop down arrow and select LIKE%...%.  Then type the word SHIPPING in all capitol letters. Click go or enter and then you'll be able to see if the text for that page is there or has been wiped out for some reason.

 

Take care

Bill

 

Hi Bill,

 

Thanks for the guidance.  Text is there but still no idea why !!

 

I'll send a screen capture.

 

Regards,

Ren.

post-155575-0-13719500-1481763435_thumb.jpg

Link to comment
Share on other sites

@@milkman45

 

I'm sorry if I'm not being clear enough. The text to the page is what's missing. The title of the page is fine. I seen it in your first image. To see if the text to the rest of the page is there you have to look in the configuration table and not the configuration_group table. The configuration_group table will show the title. The configuration table will show the text. You have to open your database and then click on the configuration table. Once it open up go to the Search tab then the configuration_key. Click the drop down arrow and select LIKE%...%.  Then type the word SHIPPING in all capitol letters. Then click go or enter to see what's there.

 

I hope that makes sense.

 

I'm not sure what you mean by table=configuration&server=

 

Take care

Bill

Link to comment
Share on other sites

Well found that the lines of information is missing in the database.

 

Checked against an old database that i used as a test bed !

 

Question as i'm not SQL proficient  .  How do i reinstate these lines in to the current database. 

 

The image is what i have to transpose to the current database.

 

 

post-155575-0-35994300-1481767885_thumb.jpg

Link to comment
Share on other sites

@@milkman45

 

That's images is exactly what I was pointing out to you!

 

It's easy to fix as long as the backup that you compared to is a RECENT backup. Like just before your errors started to happen. if it's a old backup and you've made change to your system, do NOT do what I'm going to tell you. Only do it if it's a good and recent backup.

 

If your comfort level is high when it comes to altering your database, you can do this. If not, you might want to consider hiring someone to do it for you. I have a high comfort level when I'm in my database. You may or may not, I'm not sure. It's up to you if you do this or not. Use this advice (if you wish to) at your own risk.

 

From your good backup (the one you compared to that has the correct info) open it up and search for this example:

 

LOCK TABLES `configuration` WRITE;
/*!40000 ALTER TABLE `configuration` DISABLE KEYS */;
INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
/*!40000 ALTER TABLE `configuration` ENABLE KEYS */;
UNLOCK TABLES;

 

What you need from it is all the info from the "INSERT INTO `configuration" line. Copy everything in that line and paste it into a plain text file editor and save. Something like notepad or notepad++. Not a MS Word document.

 

You do NOT need the:

 

LOCK TABLES `configuration` WRITE;
/*!40000 ALTER TABLE `configuration` DISABLE KEYS */;

 

And you do NOT need the:

 

/*!40000 ALTER TABLE `configuration` ENABLE KEYS */;
UNLOCK TABLES;

 

You need the entire line in between those and it can be a long line.

 

Go back into your database and click on the configuration table. When it opens, go to the Import tab and click it. Then click Browse and you'll be able to select the file you just saved. Once you selected your file you can click Go or Enter.

 

It will put your configuration table back to the way it was before your errors happened.

 

Take care

Bill

Link to comment
Share on other sites

What if i downloaded in pure SQL the lines missing in a TXT file , IE::

 

 

 

 

-- phpMyAdmin SQL Dump
-- version 4.0.10.14
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Dec 15, 2016 at 12:28 PM
-- Server version: 10.0.27-MariaDB-cll-lve
-- PHP Version: 5.6.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

--
-- Database: `rabhobbi_online234`
--

-- --------------------------------------------------------

--
-- Table structure for table `configuration`
--

CREATE TABLE IF NOT EXISTS `configuration` (
  `configuration_id` int(11) NOT NULL AUTO_INCREMENT,
  `configuration_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `configuration_key` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `configuration_value` mediumtext COLLATE utf8_unicode_ci NOT NULL,
  `configuration_description` varchar(800) COLLATE utf8_unicode_ci NOT NULL,
  `configuration_group_id` int(11) NOT NULL,
  `sort_order` int(5) DEFAULT NULL,
  `last_modified` datetime DEFAULT NULL,
  `date_added` datetime NOT NULL,
  `use_function` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `set_function` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`configuration_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1149 ;

--
-- Dumping data for table `configuration`
--

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
(117, 'Country of Origin', 'SHIPPING_ORIGIN_COUNTRY', '13', 'Select the country of origin to be used in shipping quotes.', 7, 1, '2015-07-22 06:43:41', '2015-07-21 19:31:37', 'tep_get_country_name', 'tep_cfg_pull_down_country_list('),
(118, 'Postal Code', 'SHIPPING_ORIGIN_ZIP', '3195', 'Enter the Postal Code (ZIP) of the Store to be used in shipping quotes.', 7, 2, '2015-07-22 06:43:50', '2015-07-21 19:31:37', NULL, NULL),
(119, 'Enter the Maximum Package Weight you will ship', 'SHIPPING_MAX_WEIGHT', '22', 'Carriers have a max weight limit for a single package. This is a common one for all.', 7, 3, '2015-07-22 06:43:57', '2015-07-21 19:31:37', NULL, NULL),
(120, 'Package Tare weight.', 'SHIPPING_BOX_WEIGHT', '.01', 'What is the weight of typical packaging of small to medium packages?', 7, 4, '2015-07-22 06:44:14', '2015-07-21 19:31:37', NULL, NULL),
(121, 'Larger packages - percentage increase.', 'SHIPPING_BOX_PADDING', '5', 'For 10% enter 10', 7, 5, '2015-07-22 06:44:22', '2015-07-21 19:31:37', NULL, NULL),
(122, 'Allow Orders Not Matching Defined Shipping Zones ', 'SHIPPING_ALLOW_UNDEFINED_ZONES', 'True', 'Should orders be allowed to shipping addresses not matching defined shipping module shipping zones?', 7, 5, '2015-08-28 07:30:54', '2015-07-21 19:31:37', NULL, 'tep_cfg_select_option(array(''True'', ''False''), ');

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;

 

This is file as an export of just the lines missing.

Can i import !

 

Thank you for your help so far.

Link to comment
Share on other sites

@@milkman45

 

I've never tried it that way, it may or may not work, I can't say for sure. Although it makes good sense and it seems that it should.

 

I have tried it the way I mentioned to you. But looking at one of the dates of your SQL Dump (2015-07-22) if you do it the way I stated, it will put your whole configuration table back to the way it was on 2015-07-22. That's why I stated it had to be a recent backup and not an old one.

 

If you do it your way you may want to consider using NOW(), NOW(), instead of the old dates and times of '2015-07-22 06:43:41', '2015-07-21 19:31:37',. I'm not sure if the old dates will work or not but, it seems NOW(), NOW(), would.

 

It's up to you. I personally would only use the INSERT INTO `configuration` lines from your SQL Dump and save them to a text file. You shouldn't need the other info since your only trying to insert some lines.

 

Take care

Bill

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...