Jump to content
Latest News: (loading..)
nedragdnuos

Weird warning in Checkout Shipping - Warning: sizeof()

Recommended Posts

Hi all, I have been doing some offline testing of my store (2.3.4.1 CE latest version on XAMP) and just want to confirm that this is a PHP 7.2 error or something else.

I am getting this error  when I go the first page of checkout (checkout_shipping.php) - 

Warning: sizeof(): Parameter must be an array or an object that implements Countable in D:\XAMP\htdocs\response\includes\classes\shipping.php on line 95

I have added the following & ~E_WARNING to includes\application_top .php to suppress the error, but I am wondering what the actual error means and if i should be concerned as to whetehr it will affect the shop when it goes live.

Any suggestions or tips would be great.

 

Cheers!

 

Edited by nedragdnuos

Share this post


Link to post
Share on other sites

@nedragdnuos The warning message is indeed related to php7.2 in that you wouldn't have got it on a previous version of php.

However, I think you shouldn't actually hit it if your shipping modules are returning the expected quotes structure.

What shipping modules are you using?


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Hmm, speak of the devil, just when I thought all was going well, I am getting this one test shop, but on the other test shop and the live shop it works fine, here is a pic of the error.

 

Now that has me stumped, none of the checkout pages have been modified.

 

shipping.PNG

Share this post


Link to post
Share on other sites

Most obvious clue: the price shows $nan (nan = not a number, an error returned by javascript when you try to do an arithmetical operation on a string or empty variable). My guess is that the shipping module is failing to get the quote properly - in the first instance try the module support thread in case someone already hit the error.


For a new install or if your store isn't mobile-friendly, get the community-supported responsive osCommerce (2.3.4.1 CE) here: https://github.com/gburton/Responsive-osCommerce/archive/2341-Frozen.zip

Working on generalising bespoke solutions for Quickbooks integration, Easify integration and pay4later (DEKO) integration at 2.3.x

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×