Forums / Built-in Shipping and Payment Modules / error codes for shipping_estimator.php

error codes for shipping_estimator.php

Views: 2,891

Results 1 to 14 of 14
5 Oct 2013, 3:40 PM
#1
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

error codes for shipping_estimator.php

I recently moved my site to a different host, and I keep getting errors showing up in the cache folder.
redsautorehab.com running zencart 1.5.0 I did not have these errors before the migration.

[05-Oct-2013 07:44:09 America/Denver] PHP Warning: Creating default object from empty value in /home2/redsauto/public_html/includes/modules/shipping_estimator.php on line 107

[05-Oct-2013 07:42:53 America/Denver] PHP Warning: Creating default object from empty value in /home2/redsauto/public_html/includes/modules/shipping_estimator.php on line 92

[05-Oct-2013 07:42:22 America/Denver] PHP Warning: Creating default object from empty value in /home2/redsauto/public_html/includes/modules/shipping_estimator.php on line 117

I have tested the shipping estimator several times, and I can't see anything wrong.
Lines 92-117:

 $order->delivery = array('postcode' => $zip_code,
                               'country' => array('id' => $_POST['zone_country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
                               'country_id' => $_POST['zone_country_id'],
                               //add state zone_id
                               'zone_id' => $state_zone_id,
                               'format_id' => zen_get_address_format_id($_POST['zone_country_id']));
      $_SESSION['cart_country_id'] = $_POST['zone_country_id'];
      //add state zone_id
      $_SESSION['cart_zone'] = $state_zone_id;
      $_SESSION['cart_zip_code'] = $zip_code;
    } elseif ($_SESSION['cart_country_id']){
      // session is available
      $_SESSION['country_info'] = zen_get_countries($_SESSION['cart_country_id'],true);
      $country_info = $_SESSION['country_info'];
      // fix here - check for error on $cart_country_id
      $order->delivery = array('postcode' => $_SESSION['cart_zip_code'],
                               'country' => array('id' => $_SESSION['cart_country_id'], 'title' => $country_info['countries_name'], 'iso_code_2' => $country_info['countries_iso_code_2'], 'iso_code_3' =>  $country_info['countries_iso_code_3']),
                               'country_id' => $_SESSION['cart_country_id'],
                               'zone_id' => $state_zone_id,
                               'format_id' => zen_get_address_format_id($_SESSION['cart_country_id']));
    } else {
      // first timer
      $_SESSION['cart_country_id'] = STORE_COUNTRY;
      $_SESSION['country_info'] = zen_get_countries(STORE_COUNTRY,true);
      $country_info = $_SESSION['country_info'];
      $order->delivery = array(//'postcode' => '',
6 Oct 2013, 7:11 AM
#2
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: error codes for shipping_estimator.php

vanhorn_s:

I recently moved my site to a different host, and I keep getting errors showing up in the cache folder.
redsautorehab.com running zencart 1.5.0 I did not have these errors before the migration.

[05-Oct-2013 07:44:09 America/Denver] PHP Warning: Creating default object from empty value in /home2/redsauto/public_html/includes/modules/shipping_estimator.php on line 107

See similar post/response here
http://www.zen-cart.com/showthread.php?122637-ozpost-shipping-module&p=1220615#post1220615

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

7 Oct 2013, 3:59 AM
#3
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

Thank you for that. I understand that it's not a big deal, but it wasn't there before the migration. Now it shows up every time a shipping quote is submitted. I can't figure out how to enable debugging in UPS, but I did enable it for USPS, and this is what I got emailed:

<?xml version="1.0"?>

<RateV4Response><Package ID="0"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable><Zone>1</Zone><Postage CLASSID="4"><MailService>Standard Post<sup>®</sup></MailService><Rate>8.85</Rate><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.95</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS Tracking<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.70</Price><PriceOnline>2.20</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.45</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="1"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="1"><MailService>Priority Mail 2-Day<sup>™</sup></MailService><Rate>8.85</Rate><CommercialRate>7.24</CommercialRate><CommitmentDate>2013-10-09</CommitmentDate><CommitmentName>2-Day</CommitmentName><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>1.95</Price><PriceOnline>1.95</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>5</ServiceID><ServiceName>Registered Mail<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>4</ServiceID><ServiceName>Registered without Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>0</ServiceID><ServiceName>Certified Mail<sup>®</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>3.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS Tracking<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.70</Price><PriceOnline>2.20</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>4.95</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.15</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.45</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="2"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>FLAT RATE ENVELOPE</Container><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="16"><MailService>Priority Mail 2-Day<sup>™</sup> Flat Rate Envelope</MailService><Rate>5.60</Rate><CommercialRate>5.05</CommercialRate><CommitmentDate>2013-10-09</CommitmentDate><CommitmentName>2-Day</CommitmentName><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>1.95</Price><PriceOnline>1.95</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>5</ServiceID><ServiceName>Registered Mail<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>4</ServiceID><ServiceName>Registered without Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>0</ServiceID><ServiceName>Certified Mail<sup>®</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>3.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS Tracking<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.70</Price><PriceOnline>2.20</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>4.95</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.15</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.45</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="3"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>LG FLAT RATE BOX</Container><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="22"><MailService>Priority Mail 2-Day<sup>™</sup> Large Flat Rate Box</MailService><Rate>16.85</Rate><CommercialRate>15.30</CommercialRate><CommitmentDate>2013-10-09</CommitmentDate><CommitmentName>2-Day</CommitmentName><SpecialServices><SpecialService><ServiceID>9</ServiceID><ServiceName>Certificate of Mailing</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>1.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>1.95</Price><PriceOnline>1.95</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>5</ServiceID><ServiceName>Registered Mail<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>4</ServiceID><ServiceName>Registered without Insurance</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>11.20</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>0</ServiceID><ServiceName>Certified Mail<sup>®</sup></ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>3.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS Tracking<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>7</ServiceID><ServiceName>Return Receipt for Merchandise</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>4.10</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.70</Price><PriceOnline>2.20</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>4.95</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.15</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.45</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package><Package ID="4"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>REGIONALRATEBOXB</Container><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="49"><MailService>Priority Mail 2-Day<sup>™</sup> Regional Rate Box B</MailService><Rate>0.00</Rate><CommercialRate>6.16</CommercialRate><CommitmentDate>2013-10-09</CommitmentDate><CommitmentName>2-Day</CommitmentName><SpecialServices><SpecialService><ServiceID>1</ServiceID><ServiceName>Insurance</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>1.95</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>13</ServiceID><ServiceName>USPS Tracking<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.00</Price><PriceOnline>0.00</PriceOnline></SpecialService><SpecialService><ServiceID>15</ServiceID><ServiceName>Signature Confirmation<sup>™</sup></ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>2.70</Price><PriceOnline>2.20</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>4.95</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.15</PriceOnline></SpecialService></SpecialServices></Postage></Package><Package ID="5"><ZipOrigination>84747</ZipOrigination><ZipDestination>84747</ZipDestination><Pounds>5</Pounds><Ounces>0</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Zone>1</Zone><Postage CLASSID="3"><MailService>Priority Mail Express 1-Day<sup>™</sup></MailService><Rate>24.85</Rate><CommercialRate>16.65</CommercialRate><CommitmentDate>2013-10-08</CommitmentDate><CommitmentName>1-Day</CommitmentName><Location>
<CutOff>3:00 PM</CutOff>
<Facility>POST OFFICE</Facility>
<Street>12 N MAIN ST</Street>
<City>LOA</City>
<State>UT</State>
<Zip>84747</Zip>
</Location>
<SpecialServices><SpecialService><ServiceID>11</ServiceID><ServiceName>Priority Mail Express Insurance</ServiceName><Available>true</Available><AvailableOnline>true</AvailableOnline><Price>0.90</Price><PriceOnline>0.90</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>false</DueSenderRequired></SpecialService><SpecialService><ServiceID>8</ServiceID><ServiceName>Return Receipt</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>2.55</Price><PriceOnline>0</PriceOnline></SpecialService><SpecialService><ServiceID>19</ServiceID><ServiceName>Adult Signature Required</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>4.95</PriceOnline></SpecialService><SpecialService><ServiceID>20</ServiceID><ServiceName>Adult Signature Restricted Delivery</ServiceName><Available>false</Available><AvailableOnline>true</AvailableOnline><Price>0</Price><PriceOnline>5.15</PriceOnline></SpecialService><SpecialService><ServiceID>6</ServiceID><ServiceName>Collect on Delivery</ServiceName><Available>true</Available><AvailableOnline>false</AvailableOnline><Price>6.45</Price><PriceOnline>0</PriceOnline><DeclaredValueRequired>true</DeclaredValueRequired><DueSenderRequired>true</DueSenderRequired></SpecialService></SpecialServices></Postage></Package></RateV4Response>

7 Oct 2013, 7:06 AM
#4
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: error codes for shipping_estimator.php

From the link I sent you:


if you do a Google search for "Creating default object from empty value" you'll find dozens of similar reports for lots of different software, along with various hints/tips as to how to rectify/hide the problem.

It is just a 'warning', and as such it won't affect the code functionality in any way,

Looking at this another way, the 'error' will/should only be reported if the PHP log level has been set to ' E_STRICT', which isn't recommended for a production site.

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

7 Oct 2013, 1:31 PM
#5
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

I have not set it to ' E_STRICT' the way I understand it, is that it is the default for 1.5.0
I did read that in your other post. My concern, is that I might have done something wrong in the migration. Stamps.com isn't working either, and I have a feeling that they might be linked.

8 Oct 2013, 12:57 AM
#6
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

I fixed it. I was running php 5.4 I had to roll it back to 5.2 to get rid of these errors, and to get stamps.com integration fixed.

8 Oct 2013, 1:06 AM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: error codes for shipping_estimator.php

Thanks for the update that you have this working now and for posting your solution ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

10 Oct 2013, 3:49 PM
#8
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: error codes for shipping_estimator.php

We have same problem after upgrading to server with php 5.4.20. we also use OzPost.
Problem only for guests, no problem after logging in or in checkout.

[11-Oct-2013 01:55:25 Australia/Sydney] PHP Warning:  Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 92

i don't think I can role back PHP on this server, and moving server is not be best option
We also get a warning with latest Fast and Easy checkout which should be for a different post

11 Oct 2013, 7:00 AM
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: error codes for shipping_estimator.php

vandiermen:

We have same problem after upgrading to server with php 5.4.20. we also use OzPost.
Problem only for guests, no problem after logging in or in checkout.

[11-Oct-2013 01:55:25 Australia/Sydney] PHP Warning: Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 92

> i don't think I can role back PHP on this server, and moving server is not be best option
> We also get a warning with latest Fast and Easy checkout which should be for a different post

Although I'm not sure if these two problems are related, if they are, you've just saved me a lot of debugging :) 

You could try this (Found via google): 

In your php.ini change   
error_reporting = E_ALL
to  error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT  If you don't have access to the php.ini, you can potentially put this in your .htaccess file:

  
php_value error_reporting 30711  This is the E_ALL value (32767) and the removing the E_STRICT (2048) and E_NOTICE (8) values.

  If you don't have access to the .htaccess file or it's not enabled,  you'll probably need to put this at the top of the PHP section of any  script that gets loaded from a browser call:

  
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);  ----------------------------------------------

  All being well this should take care of the PHP warnings, and if it takes care of the "Problem only for guests" issue with Ozpost (Which I also assume only affects guests trying to obtain overseas quotes) then that will be icing on the cake.     


Feedback will be greatly appreciated. 

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

11 Oct 2013, 12:54 PM
#10
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: error codes for shipping_estimator.php

still getting error

you may have a look at http://www.bubs2grubsknitting.com.au/index.php?main_page=popup_shipping_estimator

initially everyone gets 'Flat Rate (Express Post) $14.00' before post code is entered, with this error

[11-Oct-2013 23:39:26 Australia/Sydney] PHP Warning: Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 107

then when postcode is entered it crashes, with this error

[11-Oct-2013 23:39:34 Australia/Sydney] PHP Warning: Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 92

I believe our php.ini is working because I started getting errors about using UTC then I added date.timezone and that was fixed. I tried adding php_value error_reporting 30711 to htaccess but crashed, i can try adding it the shipping estimator but I am not even sure what it is just now, i could look at it later

11 Oct 2013, 1:50 PM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: error codes for shipping_estimator.php

vandiermen:

still getting error

I think you probably mean that you are still getting TWO DIFFERENT errors (that may or may not be related. This is still under investigation).

vandiermen:

you may have a look at http://www.bubs2grubsknitting.com.au/index.php?main_page=popup_shipping_estimator

initially everyone gets 'Flat Rate (Express Post) $14.00' before post code is entered, with this error

This is ONE of your problems, and it could well be an ozpost related issue. (This is still under investigation).

vandiermen:

[11-Oct-2013 23:39:26 Australia/Sydney] PHP Warning: Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 107

This is NOT an Ozpost related error. This is a PHP related error that has nothing to do with ozpost.
/shipping_estimator.php is one of the core zencart files and ozpost doesn't make any changes to this file in any way.

To fix this PHP related error please see the fix provided by 'robbie269'
http://www.zen-cart.com/showthread.php?122637-ozpost-shipping-module&p=1222019#post1222019

Again, this is NOT an ozpost error.

vandiermen:

then when postcode is entered it crashes, with this error
[11-Oct-2013 23:39:34 Australia/Sydney] PHP Warning: Creating default object from empty value in /home/bubsgr/public_html/includes/modules/shipping_estimator.php on line 92

This is a new one to me However, I've just looked at the code, and you should be able to apply the same fix mentioned in the linked post I just gave, however, you'll need to add the 'fix' code immediately before line#92

vandiermen:

I believe our php.ini is working because I started getting errors about using UTC then I added date.timezone and that was fixed. I tried adding php_value error_reporting 30711 to htaccess but crashed, i can try adding it the shipping estimator but I am not even sure what it is just now, i could look at it later

These fixes are/were designed to stop the error reporting rather than fixing the actual errors (which shouldn't be causing any problems anyway). The fix that robbie269 has provided is fixing the cause of the error messages. In theory, these shouldn't be affecting the ozpost processing in any way (the flat rate problem), so please keep this in mind when proving further error reports. If you treat this as a single ozpost problem you will simply confuse yourself (and me). Especially me. I'm easy to confuse :)

Cheers
Rod

NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.

11 Nov 2013, 2:07 AM
#12
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

vanhorn_s:

I fixed it. I was running php 5.4 I had to roll it back to 5.2 to get rid of these errors, and to get stamps.com integration fixed.

I need help fixing this now. My host just sent me an email telling me that php 5.2, and 5.3 will be phased out DEC. 1st.

I will also need to contact stamps.com again, and inform them that they need to make it php 5.4 compatible.

11 Nov 2013, 8:09 PM
#13
vanhorn_s avatar

vanhorn_s

Zen Follower

Join Date:
Apr 2010
Posts:
283
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

It looks like the way to eliminate this error, is to edit: includes/modules/shipping_estimator.php

Add to line 46:

 require_once('includes/classes/http_client.php'); // shipping in basket
//PHP5.4 fix
$order = new stdClass();
/*
// moved below and altered to include Tare
  // totals info
  $totalsDisplay = '';
4 Aug 2014, 10:19 AM
#14
explorer1979 avatar

explorer1979

Inactive

Join Date:
Jan 2007
Posts:
377
Plugin Contributions:
0

Re: error codes for shipping_estimator.php

I am experience this PHP warning on my ZC 1.5.1

After the ZC 1.5.3 released, I opne the ZC 1.5.3 and ZC 1.5.1 files there
/includes/modules/shipping_estimator.php
with WinMerge to compare side by side

Find the fix is

On Line 88
From
// user not logged in !
Change To
// user not logged in !
require(DIR_WS_CLASSES . 'order.php');
    $order = new order;

Add the Coding after Line 88

// user not logged in !
require(DIR_WS_CLASSES . 'order.php');
    $order = new order;