Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
*** WooCommerce Tax Changelog ***

= 3.2.3 - 2025-xx-xx =
* Fix - Resolved issue where shipping features were incorrectly loading when in tax-only mode for some installations.

= 3.2.2 - 2025-11-10 =
* Add - Allow round tax at subtotal level, instead of rounding per line.
* Add - Allow calculating taxes for VAT countries without providing ZIP.
Expand Down
2 changes: 1 addition & 1 deletion classes/class-wc-connect-help-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function page() {
);

// Shipping related.
if ( ! WC_Connect_Loader::is_wc_shipping_activated() && '1' !== WC_Connect_Options::get_option( 'only_tax' ) ) {
if ( WC_Connect_Loader::should_load_shipping_features() ) {
do_action(
'enqueue_wc_connect_script',
'wc-connect-admin-test-print',
Expand Down
3 changes: 3 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ This plugin relies on the following external services:

== Changelog ==

= 3.2.3 - 2025-xx-xx =
* Fix - Resolved issue where shipping features were incorrectly loading when in tax-only mode for some installations.

= 3.2.2 - 2025-11-10 =
* Add - Allow round tax at subtotal level, instead of rounding per line.
* Add - Allow calculating taxes for VAT countries without providing ZIP.
Expand Down
18 changes: 15 additions & 3 deletions woocommerce-services.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ public function load_admin_dependencies() {
add_action( 'admin_notices', array( $this, 'render_schema_notices' ) );

// Don't register settings if only_tax mode.
if ( '1' === WC_Connect_Options::get_option( 'only_tax' ) ) {
if ( ! self::should_load_shipping_features() ) {
return;
}

Expand Down Expand Up @@ -950,7 +950,7 @@ public function attach_hooks() {
$this->paypal_ec->init();

// Only register shipping label-related logic if WC Shipping is not active.
if ( ! self::is_wc_shipping_activated() && '1' !== WC_Connect_Options::get_option( 'only_tax' ) ) {
if ( self::should_load_shipping_features() ) {
add_action( 'rest_api_init', array( $this, 'wc_api_dev_init' ), 9999 );

$this->init_shipping_labels();
Expand Down Expand Up @@ -1950,10 +1950,22 @@ public static function has_only_tax_functionality() {
$result = ( WC_Connect_Jetpack::is_connected() && '1' === WC_Connect_Options::get_option( 'only_tax' ) ) ||
( ! WC_Connect_Jetpack::is_connected() && ! self::_has_any_labels_db_check() );

// Allow tests to override this functionality
// Allow tests to override this functionality.
return apply_filters( 'wc_connect_has_only_tax_functionality', $result );
}

/**
* Checks whether shipping-related functionality and views should be loaded.
*
* Shipping features should only be loaded when the WooCommerce Shipping plugin
* is not active and the site is not restricted to tax-only functionality.
*
* @return bool True if shipping features should be loaded, false otherwise.
*/
public static function should_load_shipping_features(): bool {
return ! self::is_wc_shipping_activated() && ! self::has_only_tax_functionality();
}

public function maybe_rename_plugin( $plugins ) {
$plugin_basename = 'woocommerce-services/woocommerce-services.php';

Expand Down
Loading