wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
215 stars 216 forks source link

Fix warning on PHP 7.1 #2303

Closed leewillis77 closed 7 years ago

leewillis77 commented 7 years ago

PHP 7.1 now throws warnings if you try to "do maths with non-numbers" (proper definitions here: http://php.net/manual/en/migration71.other-changes.php).

This causes WP e-Commerce to throw a warning on PHP 7.1 when there is something in the cart:

Warning: A non-numeric value encountered in /www/sites/wpec_stable/wp-content/plugins/wp-e-commerce/wpsc-includes/cart.class.php

This PR resolves that by initialising the per_item_shipping to float 0.0, rather than an empty string.