This repository was archived by the owner on Oct 4, 2019. It is now read-only.
Add hotfix that prevents the cheque payment method from being auto-enabled. #33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Automattic/wp-calypso#16658 and Automattic/wp-calypso#16663 for some history.
By default WC auto-enables the cheque payment method. We don't want this auto-enabled for Store on WP.com. Luckily, we are provided a filter where we can pass defaults, which are used if settings are not stored for the site (i.e. user hasn't configured the payment method). It also cleans up the default text.
It also adds a constant for easily disabling all these WP.com specific hotfixes.
To Test:
wc-api-dev
copy.wc-api-dev.php
'sinit
using thewp-admin
plugin editor and added adelete_option( 'woocommerce_cheque_settings' );
. I did a page load, and then removed this line.cheque
payment method is not displayed.http://calypso.localhost:3000/store/settings/:site
and enable thecheque
payment method. Under setup, you should see the defaults.cheque
payment method is displayed.phpunit
and make sure all tests pass (just to be safe).