BUGREPORT: WooCommerce 2.1.12 is wrongly counting the taxes?!!
-
Hello,
I am hopeless. I have installed latest WC 2.1.12 to a clean WP 3.9.1 with no caching or any additional plugins. I’ve set it up the same way as before, ie:WC > Settings > Tax > Tax options:
[x] Enable taxes and tax calculations
[x] Yes, I will enter prices inclusive of tax
Shipping Tax Class: Standard
Display prices in the shop: Including tax
Price display suffix: incl. VAT
Display prices during cart/checkout: Including tax
Display tax totals: Itemized
(check the image gallery below)WC > Settings > Tax > Standard rates:
* * * * Rate 21% VAT 1 [not selected] [x] (check image gallery below)—
Then I added a product that cost 100 (just to make it easier to see the wrong summation, btw i’m entering the prices incl. taxes), I’ve set up the VAT to 21% so the tax on the item should be 21, but WooCommerce counts it as 17.36… I don’t understand!
Gallery of screenshots of all the admin setting + frontend cart counting the totals:
https://imgur.com/a/vo1pk—
Another strange thing is that based on this tutorial (Shipping Method API): https://docs.woothemes.com/document/shipping-method-api/ I’ve created a plugin (simply by copy+pasting the code from gist on the bottom of the page, and I’ve modified it a bit to suit my needs:
<?php /* Plugin Name: DHL shipping Plugin URI: https://woothemes.com/woocommerce Description: DHL shipping method plugin Version: 1.0.0 Author: WooThemes Author URI: https://woothemes.com */ /** * Check if WooCommerce is active */ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { function dhl_shipping_method_init() { if ( ! class_exists( 'WC_DHL_Shipping_Method' ) ) { class WC_DHL_Shipping_Method extends WC_Shipping_Method { /** * Constructor for your shipping class * * @access public * @return void */ public function __construct() { $this->id = 'dhl_shipping_method'; // Id for your shipping method. Should be uunique. $this->method_title = __( 'DHL' ); // Title shown in admin $this->method_description = __( 'DHL' ); // Description shown in admin $this->enabled = "yes"; // This can be added as an setting but for this example its forced enabled $this->title = "DHL"; // This can be added as an setting but for this example its forced. $this->init(); } /** * Init your settings * * @access public * @return void */ function init() { // Load the settings API $this->init_form_fields(); // This is part of the settings API. Override the method to add your own settings $this->init_settings(); // This is part of the settings API. Loads settings you previously init. // Save settings in admin if you have any defined add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) ); } /** * calculate_shipping function. * * @access public * @param mixed $package * @return void */ public function calculate_shipping( $package ) { $rate = array( 'id' => $this->id, 'label' => $this->title, 'cost' => '100', 'calc_tax' => 'per_item' ); // Register the rate $this->add_rate( $rate ); } } } } add_action( 'woocommerce_shipping_init', 'dhl_shipping_method_init' ); function add_dhl_shipping_method( $methods ) { $methods[] = 'WC_DHL_Shipping_Method'; return $methods; } add_filter( 'woocommerce_shipping_methods', 'add_dhl_shipping_method' ); }
But the VAT for this shipping method isn’t listed in tax totals, when is this method selected, at all…
What am I doing wrong, please?
- The topic ‘BUGREPORT: WooCommerce 2.1.12 is wrongly counting the taxes?!!’ is closed to new replies.