Making sensible cart weight values
-
Hi there
I found my cart weights were being calculated to long decimal values like
2.3434344545kg
so I edited the plugin php file like so:
` <tr class=”total-weight”>
<th><?php _e( ‘Total Weight’, ‘woocommerce-cart-weight’ ); ?></th>
<td><?php
$crazyweight = $woocommerce->cart->cart_contents_weight ;
$cartweight = number_format((float)$crazyweight, 2, ‘.’, ”);
echo $cartweight . ‘ ‘ . get_option( ‘woocommerce_weight_unit’ ); ?></td>
</tr>`
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Making sensible cart weight values’ is closed to new replies.