Skip to content

fix: restore order bump product selector#1409

Merged
superdav42 merged 1 commit into
mainfrom
fix/order-bump-product-field
Jun 11, 2026
Merged

fix: restore order bump product selector#1409
superdav42 merged 1 commit into
mainfrom
fix/order-bump-product-field

Conversation

@superdav42

@superdav42 superdav42 commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Restore the order bump product selector in the checkout form field modal when another signup field registers a colliding product editor attribute.
  • Preserve duplicate editor field visibility instead of letting later field types overwrite earlier ones.
  • Add a default/binding regression for the order bump product field.

Verification

  • Browser-tested wp-admin/network/admin.php?page=wp-ultimo-edit-checkout-form&id=1&slug=main-form&model=checkout_form; the order bump modal now shows the Product selector.
  • vendor/bin/phpunit --filter Signup_Field_Order_Bump_Test
  • vendor/bin/phpcs inc/admin-pages/class-checkout-form-edit-admin-page.php inc/checkout/signup-fields/class-signup-field-order-bump.php tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php
  • Pre-commit PHPCS + PHPStan passed.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved duplicate field handling in the checkout form editor; fields with conflicting identifiers are now merged intelligently instead of being overwritten.
  • Improvements

    • Enhanced order bump field initialization with product selection defaults.
  • Tests

    • Added test coverage for product field initialization and state binding.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1639d239-daee-42ca-9ac6-8e8782dd5b82

📥 Commits

Reviewing files that changed from the base of the PR and between 6b02775 and a5501f9.

📒 Files selected for processing (3)
  • inc/admin-pages/class-checkout-form-edit-admin-page.php
  • inc/checkout/signup-fields/class-signup-field-order-bump.php
  • tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php

📝 Walkthrough

Walkthrough

The PR enhances field definition handling during checkout form editing: it implements collision detection and safe merging when field types define fields with duplicate slugs, then applies this to add and bind a product field in order bump signup configuration.

Changes

Field Collision Handling and Order Bump Product Binding

Layer / File(s) Summary
Field collision merge infrastructure
inc/admin-pages/class-checkout-form-edit-admin-page.php
get_create_field_fields() now detects duplicate field slugs across field types and merges definitions instead of overwriting; the new merge_duplicate_field_type_field() helper combines v-show expressions with OR logic when both definitions specify different visibility conditions.
Order bump product field defaults and binding
inc/checkout/signup-fields/class-signup-field-order-bump.php, tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php
Order bump field now initializes a product default and adds v-model binding to the product editor configuration; test coverage verifies both the default key existence and the Vue model binding.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Ultimate-Multisite/ultimate-multisite#703: Both PRs touch tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php, extending/asserting the same Signup_Field_Order_Bump changes around the new product default and its v-model binding.

Suggested labels

review-feedback-scanned

Poem

🐰 A field collision—oh what a sight!
We merge them gently, keeping visibility tight,
With OR expressions that dance in the show,
And product fields bound to the Vue flow,
A smooth merge it is, a delight!

🚥 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 'fix: restore order bump product selector' clearly and specifically describes the main change: restoring the product selector for order bump fields in the checkout form editor.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/order-bump-product-field

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

🔨 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 superdav42 merged commit 4c6ceed into main Jun 11, 2026
11 checks passed
@superdav42

Copy link
Copy Markdown
Collaborator Author

Summary

  • Restore the order bump product selector in the checkout form field modal when another signup field registers a colliding product editor attribute.
  • Preserve duplicate editor field visibility instead of letting later field types overwrite earlier ones.
  • Add a default/binding regression for the order bump product field.

Verification

  • Browser-tested wp-admin/network/admin.php?page=wp-ultimo-edit-checkout-form&id=1&slug=main-form&model=checkout_form; the order bump modal now shows the Product selector.
  • vendor/bin/phpunit --filter Signup_Field_Order_Bump_Test
  • vendor/bin/phpcs inc/admin-pages/class-checkout-form-edit-admin-page.php inc/checkout/signup-fields/class-signup-field-order-bump.php tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php
  • Pre-commit PHPCS + PHPStan passed.


Merged via PR #1409 to main.
Merged by deterministic merge pass (pulse-wrapper.sh).


aidevops.sh v3.20.55 spent 16m on this as a headless bash routine.

@superdav42 superdav42 added the review-feedback-scanned Merged PR already scanned for quality feedback label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-feedback-scanned Merged PR already scanned for quality feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant