• Hello
    When a pack includes products with different taxes, the final price for the shopping cart is correct but not the breakdown of the taxes. Does anybody know how to fix this problem?
    Thanks

Viewing 1 replies (of 1 total)
  • mjdewitt

    (@mjdewitt)

    I am not sure if this is the same issue, but I ran into tax calculations being wrong when mixing a non-taxable item with a taxable. It seems that by default, the bundle is declared as taxable and the individual items tax_status did not come into play. My solution was to expose the tax_status and declare it for the bundle on the admin form.

    I am still playing with this, but the cart calculations are now correct for me.

    edit admin-form.php

    Add $tax_status here:

    
    		$on_product = wcpb_utils::get_wcpb_meta( $post->ID, '_wcpb_show_bundle_on_product', 'yes' );
    		$on_cart = wcpb_utils::get_wcpb_meta( $post->ID, '_wcpb_show_bundle_on_cart', 'yes' );
    		$on_order = wcpb_utils::get_wcpb_meta( $post->ID, '_wcpb_show_bundle_on_order', 'yes' );
    		$tax_status = wcpb_utils::get_wcpb_meta( $post->ID, '_tax_status', 'yes' );
    

    Add the WC tax form code here:

    
    		woocommerce_wp_checkbox( array( 'id' => '_wcpb_show_bundle_on_product', 'label' => __( 'Show on Product Page', 'wc-product-bundles' ), 'value' => 'yes', 'cbvalue' => $on_product, 'desc_tip' => 'true', 'description' => __( 'Un check if you want to hide the bundle on product page.', 'wc-product-bundles' ) ) );
    		woocommerce_wp_checkbox( array( 'id' => '_wcpb_show_bundle_on_cart', 'label' => __( 'Show on Cart Page', 'wc-product-bundles' ), 'value' => 'yes', 'cbvalue' => $on_cart, 'desc_tip' => 'true', 'description' => __( 'Un check if you want to hide the bundle on cart.', 'wc-product-bundles' ) ) );
    		woocommerce_wp_checkbox( array( 'id' => '_wcpb_show_bundle_on_order', 'label' => __( 'Show on Order', 'wc-product-bundles' ), 'value' => 'yes', 'cbvalue' => $on_order, 'desc_tip' => 'true', 'description' => __( 'Un check if you want to hide the bundle on order.', 'wc-product-bundles' ) ) );
    		
    		echo '</div>';
    		
    				if ( wc_tax_enabled() ) {
    
    //					echo '<div class="options_group show_if_simple show_if_external show_if_variable">';
    		echo '<div class="options_group pricing hide_if_virtual hide_if_grouped hide_if_external hide_if_simple hide_if_variable show_if_wcpb">';
    
    						// Tax
    						woocommerce_wp_select( array(
    							'id'      => '_tax_status',
    							'label'   => __( 'Tax status', 'woocommerce' ),
    							'options' => array(
    								'taxable' 	=> __( 'Taxable', 'woocommerce' ),
    								'shipping' 	=> __( 'Shipping only', 'woocommerce' ),
    								'none' 		=> _x( 'None', 'Tax status', 'woocommerce' )
    							),
    							'desc_tip'    => 'true',
    							'description' => __( 'Define whether or not the entire product is taxable, or just the cost of shipping it.', 'woocommerce' )
    						) );
    
    						$tax_classes         = WC_Tax::get_tax_classes();
    						$classes_options     = array();
    						$classes_options[''] = __( 'Standard', 'woocommerce' );
    
    						if ( ! empty( $tax_classes ) ) {
    							foreach ( $tax_classes as $class ) {
    								$classes_options[ sanitize_title( $class ) ] = esc_html( $class );
    							}
    						}
    
    						woocommerce_wp_select( array(
    							'id'          => '_tax_class',
    							'label'       => __( 'Tax class', 'woocommerce' ),
    							'options'     => $classes_options,
    							'desc_tip'    => 'true',
    							'description' => __( 'Choose a tax class for this product. Tax classes are used to apply different tax rates specific to certain types of product.', 'woocommerce' )
    						) );
    
    						do_action( 'woocommerce_product_options_tax' );
    
    					echo '</div>';
    
    				}		
    
Viewing 1 replies (of 1 total)
  • The topic ‘Error taxes different types’ is closed to new replies.