Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable checkout menu when checkout block is default #45538

Conversation

nielslange
Copy link
Member

@nielslange nielslange commented Mar 13, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

Closes #44120.

This PR adds the following changes:

  • Disable the checkout menu item in the Customizer if the merchant is using a class theme and the Checkout block is the default checkout.
  • Add a notification to the Customizer with a link that points to the editor page that contains the Checkout block.

Note

The acceptance criteria on #44120 mention "If the store has a block theme, the user should be redirected to the template". As the Customizer is not visible when using a block theme, I've skipped this acceptence criteria.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Install and activate the Storefront theme.
  2. Go to WooCommerce » Settings » Advanced and set the page with the Checkout block as the checkout page.
  3. Go to Appearance » Customize » WooCommerce.
  4. Verify that the Checkout menu item is disabled.
  5. Verify that the notice Checkout can be customized in the Editor with your active theme. is visible.
  6. Verify that the link in the Editor points to the editor page that contains the Checkout block.
  7. Go to WooCommerce » Settings » Advanced and set the page with the checkout shortcode as the checkout page.
  8. Go to Apperance » Customize » WooCommerce.
  9. Verify that the Checkout menu item is not disabled and can be accessed.
  10. Verify that the notice Checkout can be customized in the Editor with your active theme. is not visible.
  11. Activate the Twenty Twenty-Four theme.
  12. Verify that Appearance » Customize is not visible.
Before:

Screenshot 2024-03-13 at 14 54 57
After:

Screenshot 2024-03-13 at 14 54 28

Changelog entry

  • Automatically create a changelog entry from the details below.

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

Disable the checkout menu within Customizer when the checkout block is the default checkout page.

Comment

@nielslange nielslange self-assigned this Mar 13, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Mar 13, 2024
@woocommercebot woocommercebot requested review from a team and senadir and removed request for a team March 13, 2024 08:01
Copy link
Contributor

Hi @senadir,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

1 similar comment
Copy link
Contributor

Hi @senadir,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

Copy link
Contributor

github-actions bot commented Mar 13, 2024

Test Results Summary

Commit SHA: 25b41e2

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 38s
E2E Tests650028603517m 43s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@nielslange nielslange force-pushed the update/44120-disable-checkout-menu-when-checkout-block-is-default branch from 3adb0fb to 2551e1f Compare March 13, 2024 08:23
Comment on lines +302 to +303
$handle = 'custom-notice';
wp_register_script( $handle, false, array( 'customize-controls' ), WC_VERSION, false );
wp_enqueue_script( $handle );
Copy link
Member Author

Choose a reason for hiding this comment

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

This section is needed to load the required dependencies. Without loading customize-controls, the notice will not appear.

@nielslange nielslange closed this Mar 13, 2024
@nielslange nielslange reopened this Mar 13, 2024
Copy link
Member

@senadir senadir left a comment

Choose a reason for hiding this comment

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

This is a clever and working workaround, thank you for working on this Niels.

@senadir senadir merged commit e91be1a into trunk Mar 14, 2024
43 checks passed
@senadir senadir deleted the update/44120-disable-checkout-menu-when-checkout-block-is-default branch March 14, 2024 14:43
@github-actions github-actions bot added this to the 8.8.0 milestone Mar 14, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Mar 14, 2024
@veljkho veljkho added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Mar 14, 2024
@nielslange
Copy link
Member Author

This is a clever and working workaround, thank you for working on this Niels.

I'm glad to hear that, @senadir. And thanks for reviewing this PR. 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Rubik
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customizer - disable Checkout menu item when the Checkout block is set as the default
3 participants