Add changelog and enable promotion in core and plugin configs #7666
Conversation
845aeee
to
36639a2
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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 |
There was a problem hiding this comment.
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.
…ot defined defaulting to 'yes'
*/ | ||
public static function evaluate( $spec ) { | ||
$rule_evaluator = new RuleEvaluator(); | ||
$suggestion = (object) $spec; | ||
$suggestion = is_array( $spec ) ? (object) $spec : clone $spec; |
There was a problem hiding this comment.
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?
$suggestion = is_array( $spec ) ? (object) $spec : clone $spec; | |
$suggestion = clone (object) $spec; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
…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'
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
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.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)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.