• Resolved jenikkrejci

    (@jenikkrejci)


    Hello.
    Please, give me an advice. What function do I get for the total weight of the order?
    Something like:
    $weight = $woocommerce->cart->cart_contents_weight;

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author algol.plus

    (@algolplus)

    Hello
    no function/method ??
    we calculate it, so try something like.

    $total_weight = 0;
    foreach ( $order->get_items('line_item') as $item_id=>$item ) {
      $product   = $order->get_product_from_item( $item );
      if( $product  )
        $total_weight += $item['qty'] * $product->get_weight();
    }
    • This reply was modified 4 years, 6 months ago by algol.plus.
    Thread Starter jenikkrejci

    (@jenikkrejci)

    Thanks, I thought so. I will buy a version with profiles. Excellent support.

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘woe_get_order_value_total_weight_items’ is closed to new replies.