Skip to content

Fix WooCommerce tax display options not being corrected on install (CO-3447) - #55

Open
MagnusPienknyJTL (jtlmagnus) wants to merge 1 commit into
developfrom
bugfix/CO-3447_woocommerce_tax_display_options
Open

Fix WooCommerce tax display options not being corrected on install (CO-3447)#55
MagnusPienknyJTL (jtlmagnus) wants to merge 1 commit into
developfrom
bugfix/CO-3447_woocommerce_tax_display_options

Conversation

@jtlmagnus

Copy link
Copy Markdown
Contributor

Summary

  • QA reported on CO-3447 that the woocommerce_tax_display_shop/woocommerce_tax_display_cart fix from PR fix: set WooCommerce tax display options on plugin activation #51 doesn't work on a real install: WooCommerce already writes its own 'excl' default into wp_options before the connector's activation hook runs, so the get_option(..., false) === false check introduced in a later "potential fix for pull request finding" commit never triggers.
  • Restores the !== 'incl' comparison so the pre-existing 'excl' default is actually corrected to 'incl'.
  • Additionally gates the correction behind a new isFirstInstall() check (based on Config::OPTIONS_INSTALLED_VERSION), so a shop owner's deliberate later change isn't reverted every time the plugin is re-activated — the concern the weakened check was originally trying (incorrectly) to address.

Test plan

  • vendor/bin/phpunit tests/src/JtlConnectorAdminTest.php — new regression test covers the WooCommerce 'excl'-default scenario, plus tests for isFirstInstall()
  • composer run phpcs / composer run phpstan — clean
  • Full vendor/bin/phpunit run — no new failures (2 pre-existing unrelated failures)

🤖 Generated with Claude Code

…O-3447)

The previous fix checked get_option(..., false) === false before forcing
'incl', but WooCommerce already writes its own 'excl' default into
wp_options before the connector's activation hook runs, so the check never
triggered and the QA-reported bug persisted. Restores the !== 'incl'
comparison and additionally gates the correction behind a new
isFirstInstall() check so a shop owner's deliberate later change is not
reverted on plugin re-activation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@jtlmagnus
MagnusPienknyJTL (jtlmagnus) requested a review from a team as a code owner August 11, 2026 12:29
@github-actions

Copy link
Copy Markdown
Contributor

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant