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.


source: Niklas Hogefjord

Artikel terkait:   WordPress: Remove query strings from static resources

Isi Komentar

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

seventy seven − seventy six =

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

Scroll to Top