Skip to content

Fix undefined $parent warning in order bump template - #1740

Merged
superdav42 merged 1 commit into
mainfrom
feature/auto-20260825-000838
Aug 25, 2026
Merged

Fix undefined $parent warning in order bump template#1740
superdav42 merged 1 commit into
mainfrom
feature/auto-20260825-000838

Conversation

@superdav42

@superdav42 superdav42 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • remove the accidental PHP check for Vue's $parent component reference
  • restore adjacent v-if and v-else order-bump controls
  • prevent an undefined-variable warning when rendering the checkout template

Testing

  • php -l views/checkout/templates/order-bump/simple.php
  • vendor/bin/phpcs views/checkout/templates/order-bump/simple.php
  • WP_TESTS_DIR=/tmp/wordpress-tests-lib vendor/bin/phpunit tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php
  • direct template render with PHP warnings converted to exceptions; confirmed both Vue branches are present

Summary by CodeRabbit

  • Bug Fixes
    • Improved order-bump controls during checkout by ensuring add/remove options and product details display correctly based on the current selection.
    • Preserved dynamic visibility of controls for a more consistent checkout experience.

@coderabbitai

coderabbitai Bot commented Aug 25, 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 Plus

Run ID: 3172533d-0e66-471e-b093-1feebc12d28e

📥 Commits

Reviewing files that changed from the base of the PR and between b835de9 and d5d94e0.

📒 Files selected for processing (1)
  • views/checkout/templates/order-bump/simple.php

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The order-bump template no longer uses a PHP guard for its controls. Vue now controls add/remove visibility, and the hidden product input remains available for submission.

Changes

Order-bump rendering

Layer / File(s) Summary
Always render order-bump controls
views/checkout/templates/order-bump/simple.php
The template always emits the Vue add/remove controls and hidden product input. Vue selects the control state from has_product.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d5d94

This localized template change removes the undefined-variable warning and restores the adjacent order-bump branches; no actionable merge-blocking risk remains after the listed checks.

🚥 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 and concisely identifies the main change: fixing the undefined $parent warning in the order-bump template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ 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 feature/auto-20260825-000838

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

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 116f869 into main Aug 25, 2026
11 checks passed
@superdav42

Copy link
Copy Markdown
Collaborator Author

Summary

  • remove the accidental PHP check for Vue's $parent component reference
  • restore adjacent v-if and v-else order-bump controls
  • prevent an undefined-variable warning when rendering the checkout template

Testing

  • php -l views/checkout/templates/order-bump/simple.php
  • vendor/bin/phpcs views/checkout/templates/order-bump/simple.php
  • WP_TESTS_DIR=/tmp/wordpress-tests-lib vendor/bin/phpunit tests/WP_Ultimo/Checkout/Signup_Fields/Signup_Field_Order_Bump_Test.php
  • direct template render with PHP warnings converted to exceptions; confirmed both Vue branches are present

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


aidevops.sh v3.32.290 spent 2m on this as a headless bash routine.

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