Merge pull request #27607 from wpdesk/bugfix/cart-weight-float

Fixed cart weight return type.
This commit is contained in:
Rodrigo Primo 2020-10-24 14:12:03 -03:00 committed by GitHub
commit 3ed300a4aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -662,10 +662,10 @@ class WC_Cart extends WC_Legacy_Cart {
* Get weight of items in the cart.
*
* @since 2.5.0
* @return int
* @return float
*/
public function get_cart_contents_weight() {
$weight = 0;
$weight = 0.0;
foreach ( $this->get_cart() as $cart_item_key => $values ) {
if ( $values['data']->has_weight() ) {