Skip to content

Add description for COD enable_for_methods field in v4 settings API#63767

Merged
mordeth merged 2 commits intotrunkfrom
update/cod-enable-for-methods-description
Mar 20, 2026
Merged

Add description for COD enable_for_methods field in v4 settings API#63767
mordeth merged 2 commits intotrunkfrom
update/cod-enable-for-methods-description

Conversation

@mordeth
Copy link
Copy Markdown
Contributor

@mordeth mordeth commented Mar 20, 2026

Motivation

The enable_for_methods field in the COD (Cash on Delivery) payment gateway's v4 settings API schema was returning an empty description string. All other fields in the COD schema have descriptive help text that explains their purpose.

This was identified while building the CIAB admin's COD settings page, where the description is displayed below the shipping methods selector.

Changes

Add a description to the enable_for_methods field in CodGatewaySettingsSchema.php:

"Choose which shipping methods support Cash on delivery."

This aligns with the design specifications and is consistent with how other fields in the schema provide contextual help text.

Testing

  1. Make a GET request to /wc/v4/settings/payment-gateways/cod
  2. Find the enable_for_methods field in the settings group
  3. Verify desc is now "Choose which shipping methods support Cash on delivery." instead of an empty string

Milestone

Note: Check the box above to have the milestone automatically assigned when merged.
Alternatively (e.g. for point releases), manually assign the appropriate milestone.

Changelog entry

  • Automatically create a changelog entry from the details below.
  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Add description for COD enable_for_methods field in v4 settings API.

Changelog Entry Comment

Comment

The enable_for_methods field in the COD gateway settings schema was
missing a description (empty string). Add a concise description that
explains the field's purpose, aligning with the design specifications.
@github-actions github-actions Bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 20, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 8f09db78-42e5-43da-a461-f24549ed721a

📥 Commits

Reviewing files that changed from the base of the PR and between f165c57 and 6426f00.

📒 Files selected for processing (1)
  • plugins/woocommerce/changelog/63767-update-cod-enable-for-methods-description
✅ Files skipped from review due to trivial changes (1)
  • plugins/woocommerce/changelog/63767-update-cod-enable-for-methods-description

📝 Walkthrough

Walkthrough

The enable_for_methods field description in the Cash on Delivery v4 REST API settings schema was changed from an empty string to a localized explanatory message: "Choose which shipping methods support Cash on delivery."

Changes

Cohort / File(s) Summary
COD Gateway Schema
plugins/woocommerce/src/Internal/RestApi/Routes/V4/Settings/PaymentGateways/Schema/CodGatewaySettingsSchema.php
Replaced an empty desc value for the enable_for_methods field with a localized description: "Choose which shipping methods support Cash on delivery."
Changelog entry
plugins/woocommerce/changelog/63767-update-cod-enable-for-methods-description
Added a new changelog file documenting the patch-level update that adds the description for the COD enable_for_methods field.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: adding a description for the COD enable_for_methods field in the v4 settings API.
Description check ✅ Passed The description is well-related to the changeset, providing clear motivation, specific changes made, testing instructions, and changelog details.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update/cod-enable-for-methods-description
📝 Coding Plan
  • Generate coding plan for human review comments

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 20, 2026

Test using WordPress Playground

The changes in this pull request can be previewed and tested using a WordPress Playground instance.
WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Test this pull request with WordPress Playground.

Note that this URL is valid for 30 days from when this comment was last updated. You can update it by closing/reopening the PR or pushing a new commit.

@mordeth mordeth self-assigned this Mar 20, 2026
@mordeth mordeth requested a review from a team March 20, 2026 09:38
@github-actions
Copy link
Copy Markdown
Contributor

Testing Guidelines

Hi @woocommerce/moltres,

Apart from reviewing the code changes, please make sure to review the testing instructions (Guide) and verify that relevant tests (E2E, Unit, Integration, etc.) have been added or updated as needed.

Reminder: PR reviewers are required to document testing performed. This includes:

  • 🖼️ Screenshots or screen recordings.
  • 📝 List of functionality tested / steps followed.
  • 🌐 Site details (environment attributes such as hosting type, plugins, theme, store size, store age, and relevant settings).
  • 🔍 Any analysis performed, such as assessing potential impacts on environment attributes and other plugins, conducting performance profiling, or using LLM/AI-based analysis.

⚠️ Within the testing details you provide, please ensure that no sensitive information (such as API keys, passwords, user data, etc.) is included in this public issue.

Copy link
Copy Markdown
Contributor

@oaratovskyi oaratovskyi left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:

@mordeth mordeth merged commit d66cde4 into trunk Mar 20, 2026
39 checks passed
@mordeth mordeth deleted the update/cod-enable-for-methods-description branch March 20, 2026 10:18
@github-actions github-actions Bot added this to the 10.7.0 milestone Mar 20, 2026
@github-actions github-actions Bot added the needs: documentation The issue/PR requires documentation to be added. label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs: documentation The issue/PR requires documentation to be added. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants