Show Total Weight in Woocommerce

Add code below in your theme function, function.php to show total weight in Woocommerce.

/**
* WooCommerce
* --------------
*
* Display cart total weight on the cart page
*
*/
add_action('woocommerce_cart_collaterals', 'myprefix_cart_extra_info');

function myprefix_cart_extra_info() {
global $woocommerce;
echo '<div class="cart-extra-info">';
echo '<p class="label label-info total-weight">' . __('Total Berat:', 'woocommerce');
echo ' ' . $woocommerce->cart->cart_contents_weight . ' ' . get_option('woocommerce_weight_unit');
echo '</p>';
echo '</div>';
}

Here what look likes from the code.
Cart   TokoSunnah.net

 

source: Niklas Hogefjord

Artikel terkait:   JW Player: Play Shoutcast Livestream in JW Player 6

Isi Komentar

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *

− two = eight

This site uses Akismet to reduce spam. Learn how your comment data is processed.