Why woocommerce returns only the integer part of the size?

Hi all,
suppose you have hundred is the product of width and height 5.75 15.45 and the following function:
$product = new WC_Product($id);

public function get_sizes($product) {
 $w_size = floatval($product->get_width());
 $h_size = floatval($product->get_height());

 $w_M = intval($w_size);
 $h_M = intval($h_size);
 $w_CM = $w_size - intval($w_size);
 $h_CM = $h_size - intval($h_size);

 return array($w_M, $h_M, $w_CM, $h_CM); 
}


But for some reason, $product->get_width() and get_height() return only 5 and 15.
July 4th 19 at 23:07
0 answer

Find more questions by tags PHPWooCommerceWordPress