protected function sumTotalVolume(&$total, array &$item, array $order)
    {
        $product = &$item['product'];

        if (empty($product['width']) || empty($product['height']) || empty($product['length'])) {
            return null;
        }

        if ($product['size_unit'] !== $order['size_unit']) {

            try {
                $product['width'] = $this->convertor->convert($product['width'], $product['size_unit'], $order['size_unit']);
                $product['height'] = $this->convertor->convert($product['height'], $product['size_unit'], $order['size_unit']);
                $product['length'] = $this->convertor->convert($product['length'], $product['size_unit'], $order['size_unit']);

            } catch (Exception $ex) {
                return null;
            }

            $product['size_unit'] = $order['size_unit'];
        }

        $volume = (float) ($product['width'] * $product['height'] * $product['length']);
        $total += (float) ($volume * $item['quantity']);
        return null;
    }
protected function sumTotalVolume(&$total, array &$item, array $order)
    {
        $product = &$item['product'];

        if (empty($product['width']) || empty($product['height']) || empty($product['length'])) {
            return null;
        }

        if ($product['size_unit'] !== $order['size_unit']) {

            try {
                $product['width'] = $this->convertor->convert($product['width'], $product['size_unit'], $order['size_unit']);
                $product['height'] = $this->convertor->convert($product['height'], $product['size_unit'], $order['size_unit']);
                $product['length'] = $this->convertor->convert($product['length'], $product['size_unit'], $order['size_unit']);

            } catch (Exception $ex) {
                return null;
            }

            $product['size_unit'] = $order['size_unit'];
        }

        $volume = (float) ($product['width'] * $product['height'] * $product['length']);
        $total += (float) ($volume * $item['quantity']);
        return null;
    }
protected function sumTotalVolume ( & $ total , array & $ item , array $ order ) { $ product = & $ item [ 'product' ] ; if ( empty ( $ product [ 'width' ] ) || empty ( $ product [ 'height' ] ) || empty ( $ product [ 'length' ] ) ) { return null ; } if ( $ product [ 'size_unit' ] !== $ order [ 'size_unit' ] ) { try { $ product [ 'width' ] = $ this -> convertor -> convert ( $ product [ 'width' ] , $ product [ 'size_unit' ] , $ order [ 'size_unit' ] ) ; $ product [ 'height' ] = $ this -> convertor -> convert ( $ product [ 'height' ] , $ product [ 'size_unit' ] , $ order [ 'size_unit' ] ) ; $ product [ 'length' ] = $ this -> convertor -> convert ( $ product [ 'length' ] , $ product [ 'size_unit' ] , $ order [ 'size_unit' ] ) ; } catch ( Exception $ ex ) { return null ; } $ product [ 'size_unit' ] = $ order [ 'size_unit' ] ; } $ volume = ( float ) ( $ product [ 'width' ] * $ product [ 'height' ] * $ product [ 'length' ] ) ; $ total += ( float ) ( $ volume * $ item [ 'quantity' ] ) ; return null ; }
Sum volume totals
@param float $total
@param array $item
@param array $order
@return null
Sum volume totals