Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Dan

    (@dangoodman)

    Thank you!

    You need to patch WooCommerce cart somehow to show total weight either by an existing or a custom plugin.

    Thread Starter mohitthkkr

    (@mohitthkkr)

    Isnt there any function which stores the total value of the cart ?? I can echo that function on the page.

    Plugin Author Dan

    (@dangoodman)

    Sure, it is. Look for WC()->cart->cart_contents_weight variable.

    Thread Starter mohitthkkr

    (@mohitthkkr)

    <tr class=”total weight”>
    <th><?php _e(‘Total Weight’, ‘woocommerce’); ?></th>
    <td><?php
    $total_weight = $woocommerce->cart->cart_contents_weight;
    $total_weight .= ‘ ‘.get_option(‘woocommerce_weight_unit’);
    echo $total_weight;
    ?>
    </td>
    </tr>

    I added this code to cart-totals.php file but $woocommerce->cart->cart_contents_weight doesnt return any weight.

    Plugin Author Dan

    (@dangoodman)

    This is not related to WBS plugin. I think you’d better ask for that question on woocommerce support forums.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display Total Weight’ is closed to new replies.