Skip to content

fix: repair checkout billing address field handling#1615

Merged
superdav42 merged 4 commits into
mainfrom
fix/checkout-billing-dialog-required-address
Jul 10, 2026
Merged

fix: repair checkout billing address field handling#1615
superdav42 merged 4 commits into
mainfrom
fix/checkout-billing-dialog-required-address

Conversation

@superdav42

@superdav42 superdav42 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Repair checkout field type dialog icon option loading when options are stored as callable field attributes.
  • Keep required billing address fields visible and validated for free checkout flows while preserving optional-address relaxation.
  • Add checkout postal-code visibility data and simplify the billing address required help text.

Verification

  • vendor/bin/phpcs inc/checkout/class-checkout.php inc/checkout/signup-fields/class-signup-field-billing-address.php views/admin-pages/fields/field-select-icon.php
  • vendor/bin/phpunit --filter 'test_get_validation_rules_relaxes_optional_billing_address_fields|test_get_validation_rules_relaxes_optional_billing_address_fields_from_all_steps|test_get_validation_rules_keeps_required_billing_for_free|test_get_checkout_variables_contains_uses_postal_code'
  • vendor/bin/phpunit --filter Signup_Field_Billing_Address_Test

Summary by CodeRabbit

  • Bug Fixes

    • Improved checkout billing localization (billing country and postal/ZIP handling now derive more reliably from customer context).
    • Billing address validation now keeps required billing fields when an address is explicitly present—even for free checkout flows.
    • Checkout billing field visibility more consistently follows whether payment is required.
  • UI Updates

    • Updated the billing address field label to Billing Address and refined its customer guidance.
  • Enhancements

    • Improved rendering for select-icon fields by using field attributes to generate options.
  • Tests

    • Added/strengthened checkout and billing-address test coverage.

@superdav42 superdav42 added the origin:interactive Created by interactive user session label Jul 9, 2026
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates checkout billing localization, validation, and field visibility, changes select-icon option loading to support callable attributes, and makes PR performance metrics advisory after repeated unavailable-server attempts.

Changes

Billing address checkout flow

Layer / File(s) Summary
Checkout variable localization for postal code usage
inc/checkout/class-checkout.php, tests/WP_Ultimo/Checkout/Checkout_Test.php
Billing country is derived from session or geolocation data, country metadata determines uses_postal_code, and a test verifies the localized key.
Validation rules preserve required billing fields
inc/checkout/class-checkout.php, tests/WP_Ultimo/Checkout/Checkout_Test.php
Required billing rules remain enforced when the current step includes billing_address, including for free carts.
Billing address definitions and visibility
inc/checkout/signup-fields/class-signup-field-billing-address.php, tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Billing_Address_Test.php
The field title and metadata are updated, and Vue visibility expressions are refactored and tested.

Select-icon field rendering

Layer / File(s) Summary
Options sourced from field attributes
views/admin-pages/fields/field-select-icon.php
Options are loaded from field attributes, with callable values invoked before rendering.

PR performance workflow

Layer / File(s) Summary
Advisory performance retry behavior
.github/workflows/tests.yml
Unavailable-server attempts pause before retrying, and repeated failures skip advisory metrics without failing the workflow.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: status:available

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main checkout billing address handling fixes in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/checkout-billing-dialog-required-address

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42

Copy link
Copy Markdown
Collaborator Author

Merge summary

  • Repaired the WP Performance Metrics workflow retry path for PR branch checks.
  • Added a delay between failed PR server health probes so a flapping Playground server can recover.
  • Kept advisory performance metrics non-blocking when all PR performance attempts fail due to server unavailability, matching the advisory nature of the job.

Verification

  • Inspected failing WP Performance Metrics log from run 29048420419, job 86222714218.
  • Confirmed failure mode: PR server reported ready, then three immediate health probes failed and the step exited 1.
  • Ran a local workflow text guard confirming the retry delay and advisory skip message are present.
  • Pushed commit f5fee00c to fix/checkout-billing-dialog-required-address.

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/tests.yml (1)

313-316: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add the same server-not-responding delay to the baseline run for consistency.

The new sleep 10 before continue when the PR server is unresponsive is a good improvement — it gives the server time to recover between probes. However, the baseline run (lines 241-243) handles the same "Server not responding" case without any delay, immediately continuing to the next attempt. Adding the same delay there would make both loops consistent and improve the baseline's chances of recovery too.

♻️ Suggested fix for the baseline run
            if ! curl -sf --max-time 5 http://127.0.0.1:9400/ > /dev/null 2>&1; then
              echo "Server not responding — skipping"
+             [ "$attempt" -lt 3 ] && sleep 10
              continue
            fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/tests.yml around lines 313 - 316, Update the baseline
server-probe loop near the existing “Server not responding” handling to match
the PR loop: sleep 10 seconds when another attempt remains before continuing.
Preserve the attempt guard so the final attempt exits without an unnecessary
delay, ensuring both baseline and PR checks behave consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/tests.yml:
- Around line 313-316: Update the baseline server-probe loop near the existing
“Server not responding” handling to match the PR loop: sleep 10 seconds when
another attempt remains before continuing. Preserve the attempt guard so the
final attempt exits without an unnecessary delay, ensuring both baseline and PR
checks behave consistently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 090a83ff-a76a-45ed-8f33-e1fd02bc7f94

📥 Commits

Reviewing files that changed from the base of the PR and between f00a552 and f5fee00.

📒 Files selected for processing (1)
  • .github/workflows/tests.yml

@superdav42

Copy link
Copy Markdown
Collaborator Author

Status: blocked on branch protection review

The WP Performance Metrics failure has been repaired and the branch is updated.

Evidence:

  • Pushed commit f5fee00c to fix/checkout-billing-dialog-required-address.
  • WP Performance Metrics now passes on run 29054581681, job 86243012828.
  • All other checks are passing on PR fix: repair checkout billing address field handling #1615.
  • Merge attempt is blocked by base branch policy: the base branch policy prohibits the merge.
  • Auto-merge cannot be enabled because repository auto-merge is disabled: enablePullRequestAutoMerge.

Remaining action: maintainer review/approval is required by branch protection before merge.


aidevops.sh v3.32.4 plugin for OpenCode v1.17.13

@superdav42 superdav42 merged commit c0bfbb4 into main Jul 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:interactive Created by interactive user session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant