Merge pull request #27607 from wpdesk/bugfix/cart-weight-float
Fixed cart weight return type.
This commit is contained in:
commit
3ed300a4aa
|
@ -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() ) {
|
||||
|
|
Loading…
Reference in New Issue