Skip to content

feat(settings): bridge seller_enable_terms_and_conditions legacy key#3247

Open
akzmoudud wants to merge 2 commits into
refactor/simplify-settings-to-flat-arrayfrom
feat/bridge-legacy-settings-mappings
Open

feat(settings): bridge seller_enable_terms_and_conditions legacy key#3247
akzmoudud wants to merge 2 commits into
refactor/simplify-settings-to-flat-arrayfrom
feat/bridge-legacy-settings-mappings

Conversation

@akzmoudud
Copy link
Copy Markdown
Contributor

@akzmoudud akzmoudud commented Jun 5, 2026

Changes proposed in this Pull Request:

Maps the legacy dokan_general.seller_enable_terms_and_conditions option into the new flat-array settings schema so upgraded sites migrate cleanly through LegacySettingsBridge.

  • SettingsSchema.php — add a Store Terms and Conditions switch field under Compliance › Privacy (privacy_settings section), default off, with legacy_key => dokan_general.seller_enable_terms_and_conditions.

This is the Lite half of the dokan_general Store T&C mapping; the Pro half (enable_tc_on_reg) ships in the companion Pro PR.

Related Pull Request(s)

Closes

How to test the changes in this Pull Request:

  1. New settings (admin.php?page=dokan-dashboard) → Compliance › Privacy → toggle Store Terms and Conditions ON → Save.
  2. Confirm legacy option updates: wp option get dokan_general --format=jsonseller_enable_terms_and_conditions = on.
  3. Old settings (admin.php?page=dokan) → General › Vendor Store SettingsStore Terms and Conditions reflects the change (verified end-to-end).

Changelog entry

Bridge Store Terms and Conditions setting to the new settings schema

Previously the new flat-schema settings had no field mapped to the legacy dokan_general.seller_enable_terms_and_conditions option, so the value wouldn't migrate. This PR adds the mapped field under Compliance › Privacy.

After Changes

New UI Store Terms and Conditions toggle saves straight back to the legacy dokan_general option (write-back verified); the old settings page reads it transparently.

Add a 'Store Terms and Conditions' switch under Compliance > Privacy that
bridges to the legacy dokan_general.seller_enable_terms_and_conditions
option via LegacySettingsBridge, so upgraded sites migrate cleanly.

Refs #1931
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7fddd4fe-e31b-4f1c-815a-efefa7d36c98

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bridge-legacy-settings-mappings

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.

…at-array' into feat/bridge-legacy-settings-mappings

# Conflicts:
#	includes/Admin/Settings/Schema/SettingsSchema.php
@akzmoudud akzmoudud self-assigned this Jun 8, 2026
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