Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

Add changelog and enable promotion in core and plugin configs #7666

Merged
merged 9 commits into from Sep 27, 2021

Conversation

louwie17
Copy link
Contributor

@louwie17 louwie17 commented Sep 15, 2021

Fixes #7319

This is the final change enabling the feature in all environments.

I will also generate a zip after the above merge for easier testing on Jurassic.

Previous PRs:
#7550
#7553
#7554

Screenshots

Screen Shot 2021-08-27 at 3 44 28 PM

Detailed test instructions:

*once the above PR is merged this might only work with Jetpack enabled (so I thought) the actual experiment is still in staging so it might not work. Instead you can test with this zip - woocommerce-admin.zip, which uses the explat_test_v4_woocommerce_wc_pay_promotion_payment_methods_table_v1 experiment, which is active.

  1. Grab the attached zip or load this branch locally
  2. Finish the onboarding flow and make sure you click 'yes' for collecting data also don't install WC Pay.
  3. Go to the Abacus experiment woocommerce_wc_pay_promotion_payment_methods_table_v1 and grab the treatment bookmarklet (save it to your bookmarks tab) with the above zip, grab the treatment bookmarklet from this experiment instead:
    explat-test-v4-woocommerce-wc-pay-promotion-payment-methods-table-v1 (ping me for the link as you can find it in Abacus)
  4. Go back to your WC page and click the bookmarklet, a success message should popup.
  5. Navigate to WooCommerce > Settings > Payments
  6. WooCommerce Payments should be at the top of the payment method table with a Install button, a Recommended ways to get paid box will show up below the table, WooCommerce Payments should Not be part of this.
  7. Click Install, it should show as busy and redirect you to the WC Pay set up screen when installed.
  8. Navigate to WooCommerce > Settings > Payments again
  9. WooCommerce Payments should still be at the top but with a Set up button now instead of an Install button.
  10. You might have to wait 24 hours, but go to the Abacus experiment it should contain results from the test (this might require the experiment to be running)
  11. Follow the above steps again but with the control variation, which would make the WC Pay not show up in the payment method table, but in the recommended card instead.
    Note: This might require a new site as the experiment variation is saved in a transient.

@louwie17 louwie17 added the status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. label Sep 15, 2021
@louwie17 louwie17 force-pushed the update/7319_enable_wc_pay_experiment branch from 845aeee to 36639a2 Compare September 23, 2021 12:01
@louwie17 louwie17 added status: needs review and removed status: blocked The issue is blocked from progressing, waiting for another piece of work to be done. labels Sep 23, 2021
@louwie17 louwie17 requested a review from a team September 23, 2021 12:32
Copy link
Contributor

@mattsherman mattsherman left a comment

Choose a reason for hiding this comment

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

Tested on JN with provided zip. Both treatment and control variants worked as expected.

Code changes look good. Left a comment about the changelog comment. Pre-approving, as that change is very minor!

Significance: minor
Type: Enhancement

Adds experiment for promoting wcpay in payment methods table. #7666
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we spell out WooCommerce Payments in this changelog entry?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also very nitpicky and something we aren't consistent on is verb tense in changelogs.

Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

Testing well for me! Great work on this feature, @louwie17 🎉 🎉

Significance: minor
Type: Enhancement

Adds experiment for promoting wcpay in payment methods table. #7666
Copy link
Contributor

Choose a reason for hiding this comment

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

Also very nitpicky and something we aren't consistent on is verb tense in changelogs.

*/
public static function evaluate( $spec ) {
$rule_evaluator = new RuleEvaluator();
$suggestion = (object) $spec;
$suggestion = is_array( $spec ) ? (object) $spec : clone $spec;
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't remember if this works in PHP or not, but can we clone and coerce to an object at the same time?

Suggested change
$suggestion = is_array( $spec ) ? (object) $spec : clone $spec;
$suggestion = clone (object) $spec;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we could do that, this would technically cause a array to be cloned twice (in essence), creating a new object out of it first and then cloning that new object.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good point. Let's leave it as is.

Copy link
Contributor

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

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

Changes look good! Nice work, @louwie17!

@louwie17 louwie17 merged commit 6546db6 into main Sep 27, 2021
@louwie17 louwie17 deleted the update/7319_enable_wc_pay_experiment branch September 27, 2021 13:24
ObliviousHarmony pushed a commit to woocommerce/woocommerce that referenced this pull request Mar 18, 2022
…merce/woocommerce-admin#7666)

* Add changelog and enable promotion in core and plugin configs

* Add PR number

* Make variation name a constant

* Clone spec as we are overwriting the is_visible prop

* Fix unit tests and support array and object

* Revert explat variation name

* Update changelog entry

* Update changelog once more

* Make sure the recommendations show up if marketplace suggestions is not defined defaulting to 'yes'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show WooCommerce Payments Promotion in Payment Methods table before it is installed
3 participants