Closed. This question is off-topic. It is not currently accepting answers.admin管理员组文章数量:1404927
Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionWe have a pretty tricky problem: We run a german Woocommerce shop. All prices are including 19% VAT. For Austria we have to calculate 20%, but the prices including VAT should be the same. This can be easily done using the woocommerce_adjust_non_base_location_prices filter.
Now comes the tricky part: Since Switzerland is not part of the EU, products are sold excluding VAT. If we set the VAT settings for Switzerland to 0%, it's not working anymore with the filter added. Example:
Product costs 100 EUR including 19% VAT.
German buyers pay 100 EUR including 16 EUR VAT Austrian buyers pay 100 EUR including 17 EUR VAT Buyers from Switzerland SHOULD pay 84 EUR (100 EUR - 16 EUR VAT), but the system calculates 100 EUR.
A quick and dirty workaround would be to exclude the filter for buyers from Switzerland. I tried:
add_action( 'woocommerce_checkout_update_order_review', 'vd_adjust_ch_prices', 0, 1 );
public function vd_adjust_ch_prices( $post_data ) {
if ( isset( $_POST['country'] ) && ! in_array( $_POST['country'], WC()->countries->get_european_union_countries() ) || ( ! isset( $_POST['country'] ) && ! in_array( WC()->checkout()->get_value('billing_country'), WC()->countries->get_european_union_countries() ) ) ) {
add_filter( 'woocommerce_product_is_taxable', '__return_false', 20 );
}
}
The snippet does not work, and don't know why. Any ideas?
Closed. This question is off-topic. It is not currently accepting answers.Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.
Closed 5 years ago.
Improve this questionWe have a pretty tricky problem: We run a german Woocommerce shop. All prices are including 19% VAT. For Austria we have to calculate 20%, but the prices including VAT should be the same. This can be easily done using the woocommerce_adjust_non_base_location_prices filter.
Now comes the tricky part: Since Switzerland is not part of the EU, products are sold excluding VAT. If we set the VAT settings for Switzerland to 0%, it's not working anymore with the filter added. Example:
Product costs 100 EUR including 19% VAT.
German buyers pay 100 EUR including 16 EUR VAT Austrian buyers pay 100 EUR including 17 EUR VAT Buyers from Switzerland SHOULD pay 84 EUR (100 EUR - 16 EUR VAT), but the system calculates 100 EUR.
A quick and dirty workaround would be to exclude the filter for buyers from Switzerland. I tried:
add_action( 'woocommerce_checkout_update_order_review', 'vd_adjust_ch_prices', 0, 1 );
public function vd_adjust_ch_prices( $post_data ) {
if ( isset( $_POST['country'] ) && ! in_array( $_POST['country'], WC()->countries->get_european_union_countries() ) || ( ! isset( $_POST['country'] ) && ! in_array( WC()->checkout()->get_value('billing_country'), WC()->countries->get_european_union_countries() ) ) ) {
add_filter( 'woocommerce_product_is_taxable', '__return_false', 20 );
}
}
The snippet does not work, and don't know why. Any ideas?
Share Improve this question asked Dec 27, 2019 at 18:05 user2516117user2516117 771 silver badge8 bronze badges1 Answer
Reset to default 0If I'm not mistaken ... Then all these settings with taxes and countries are in woocommerce in a box. You only need to configure it correctly.
本文标签: Woocommerce Same gross price for different tax rates
版权声明:本文标题:Woocommerce: Same gross price for different tax rates 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744874559a2629837.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论