https://www.loom.com/share/ef6e5c0e3c6f46b7a84aecfb123c814b?sid=1707952d-cf9e-476d-add1-0928b58b56ee
Does anyone know why this is happening?
]]>My current tax settings apply 20% VAT to products and shipping within the EU and Zero rate outside of these area’s. My tax settings are set to calculate via customers shipping address, and all settings are set to add and show prices always inclusive.
Now it may be important to note, that I am trying to recalculate taxes on old orders that when placed (at the time of ordering) tax was disabled and not used. And so we are going through old orders to try and recalculate so that we can reconcile our accounts with QuickBooks after importing transactions.
So the problem in short is that when I hit the “Recalculate” button in the order admin, it recalculates and adds the tax as an additional 20% charge meaning the order is now 20% more than the customer originally paid.
N.B. we have tried a number of suggestions already
1) Added add_filter( ‘woocommerce_adjust_non_base_location_prices’, ‘__return_false’ ); to funtions.php file.
2) Altered _postmeta field “_prices_include_tax” from “no” to “yes” for the order ID and again tried to recalculate (still fails).
I suppose there might be other aspects to consider while enabling this ability to vendors such as suborders or more. I wonder if there is a quick fix for this capability.
When an order has been made, order status becomes “Processing”. At that state for the admin, it says “This order is no longer editable.” After changing the order status to “Pending Payment”, Add Item(s), Apply Coupon, Refund, and Recalculate buttons, and as well as “Edit item” pen on the right hand of the order item line will appear on the Admin side. But these options won’t appear on the Vendor dashboards. By using the “Edit item” pen three additional sections will also appear at the bottom. These are Add Product(s), Add fee, Add shipping buttons.
We need this flexibility to operate seamlessly with Vendors.
As it will allow them to recalculate their orders by editing the inputs such as “Before Discount” boxes, “Items Subtotal” lines. And by showing their discounts and additional fees more clearly, and also by adding additional products if they need to these orders, they will be in control of their own order structures properly.
What do you think?
]]>Is there a workaround, setting, pluging, snippet that can fix this ie: make an automated caclculation upon adding products or adding the tax whenever the product is added instead of needing to hit recalculatet?
]]>When setting up a site the owner forgot to activate taxes. She now asked me to correct it and I have:
Now when placing a new order, the tax gets show correctly on checkout and invoice. The tax is not added to the productprice but is shown as being included in the price & ordertotal.
Productprice 14,95
Tax 3,14 (product price excl. tax 12,35)
Total: 14,95
Recalculating old orders
For the previous orders when tax was not enabled however it is a different story:
Woocommerce offers the ability to recalculate orders. If I do this for an old order: the tax is added to the product price instead of shown to be included in the product price.
Productprice 14,95
Tax 3,14
Total: 18,09
As you can see recalculation ignores the setting that the productprice includes VAT.
Have you seen this behaviour, or do you have an idea how to solve this problem?
]]>To automate this process, I created a script that calculates the 3% charge once the shipping charge has been set through the backend and adds this fee item into the order automatically. This works when we add the shipping charge and click save/recalculate the *first* time.
add_action( 'woocommerce_order_after_calculate_totals', "custom_order_after_calculate_totals", 10, 2);
function custom_order_after_calculate_totals($and_taxes, $order) {
if ( did_action( 'woocommerce_order_after_calculate_totals' ) >= 2 )
return;
if ( is_admin() && ! defined( 'DOING_AJAX' ) )
return;
$percentage = 0.03;
$total = $order->get_total();
$surcharge = $total * $percentage;
$feeArray = array(
'name' => '3% CC Fee',
'amount' => wc_format_decimal($surcharge),
'taxable' => false,
'tax_class' => ''
);
//Get fees
$fees = $order->get_fees();
if(empty($fees)){
//Add fee
$fee_object = (object) wp_parse_args( $feeArray );
$order->add_fee($fee_object);
} else {
//Update fee
foreach($fees as $item_id => $item_fee){
if($item_fee->get_name() == "3% CC Fee"){
$order->update_fee($item_id,$feeArray);
}
}
}
}
If we decide to update the shipping cost, this code does get triggered again and attempts to update the fee however $total
does not get the new order total from the updated shipping cost and so the fee does not change. Strangely enough, if I try to delete the fee item, a new fee is calculated and is added back with the correct fee amount.
Anybody know how I can solve this?
]]>I have turned on taxes on my WooCommerce. I set shipping method (Flat rate – https://wpdesk.me/mo/5an7y.png) with no taxes. When I place order, the shipping method is not taxed, and it is the expected result. But when I push recalculate button on the admin’s order page, the shipping is updating with extra 6z?. https://wpdesk.me/mo/dkyms.mp4
Tax settings page: https://wpdesk.me/mo/o23cr.png
Why is this happening? How to avoid it?
Best regards,
Mateusz