Reply To: VAT

#94557
Tom Anbinder
Moderator
Plugin Support

Hi Remi,

We’ve just released new plugin version 1.3.0. I didn’t add option to enter price with VAT, however I did add alg_wc_custom_shipping_methods_evaluate_cost_sum_evaluated filter that is applied just before the shipping cost is returned. So now you can modify the cost by adding something like this to your (child) theme’s functions.php file:

add_filter( 'alg_wc_custom_shipping_methods_evaluate_cost_sum_evaluated', 'custom_modify_shipping_cost', 10, 1 );
if ( ! function_exists( 'custom_modify_shipping_cost' ) ) {
	function custom_modify_shipping_cost( $sum ) {
		if ( WC()->cart->get_customer() && ! WC()->cart->get_customer()->get_is_vat_exempt() ) {
			$sum = $sum * 1.21;
		}
		return $sum;
	}
}

If you could give more info on when you need to add/remove VAT from cost – I could try to provide you with the exact code to add.

Also if you wish, you can share an admin account to your site (WP and FTP) so I could login and help you with solving the task – my private email is [email protected]

Hope that helps.