Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3839646
Tax Rate and Bundle weight
Open

Comments

  •  2
    Ajedrezon started the conversation

    Hi there,

    I have a bundle with a standart tax rate product and a reduced tax rate product together. How can a set the tax rate individually for each product on the bundle?

    I thought the plugin get each product tax automatically, but I'm not sure.

    I also would know please if I have to set a bundle weight for the shipping or if it records and adds up the weight of each product on the bundle automatically.

    Thanks in advance

  •  1,408
    Dustin replied

    Hi Ajedrezon,

    #1. Regarding tax rate:

    When you use automatic pricing for a bundle, prices, and taxes are calculated from the bundle's child products. Conversely, when you use fixed pricing for a bundle, prices and taxes are calculated from the main bundle product. You can switch between 2 pricing modes here:

    8782993139.png

    #2. Regarding shipping fee:

    Similar to the pricing above, you can also switch between the two shipping calculation methods here:

    1060674040.png

    Best regards,
    Dustin

  •  2
    Ajedrezon replied

    Thanks Dustin for the detailed answer.

    Regards shipping fee, I'm not sure I understood. My concern is about the product weight. I would like the plugin to calculate automatic the weight of the bundle adding up the weight of each child products. So in that case, what option I have to set?

    Best regards

  •  1,408
    Dustin replied

    Our plugin doesn't calculate the weight automatically since it can be changed when the buyer changes the variation or quantity of bundled sub-products.

    Suppose you use the predefined bundles only and want to calculate the weight for bundles; please add the custom code below. (How to add custom code? ↗):

    add_filter( 'woocommerce_product_get_weight', function ( $weight, $product ) {
    	if ( $product->is_type( 'woosb' ) && ( $items = $product->get_items() ) ) {
    		$woosb_weight = 0;
    
    		foreach ( $items as $item ) {
    			$woosb_product = wc_get_product( $item['id'] );
    
    			if ( ! $woosb_product || $woosb_product->is_type( 'woosb' ) ) {
    				continue;
    			}
    
    			if ( $woosb_product_weight = $woosb_product->get_weight() ) {
    				$woosb_weight += (float) $woosb_product_weight * $item['qty'];
    			}
    		}
    
    		return $woosb_weight;
    	}
    
    	return $weight;
    }, 99, 2 );

    Best regards,
    Dustin