-
Notifications
You must be signed in to change notification settings - Fork 815
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
Integrate WooCommerce with Jetpack Sync #5708
Conversation
0016bdb
to
892b720
Compare
@@ -340,3 +355,5 @@ static function init_sync_cron_jobs() { | |||
|
|||
// We need to define this here so that it's hooked before `updating_jetpack_version` is called | |||
add_action( 'updating_jetpack_version', array( 'Jetpack_Sync_Actions', 'do_initial_sync' ), 10, 2 ); | |||
|
|||
add_action( 'plugins_loaded', array( 'Jetpack_Sync_Actions', 'setup_woocommerce' ) ); |
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.
is plugins_loaded
isn't "early" enough?
performance wise maybe it is better just to initialise the module/listeners even if woo isn't installed?
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.
plugins_loaded is before init, and is the earliest we can detect whether woo has been enabled. Performance-wise, I don't think this adds much overhead. Which part do you think is expensive?
I think this expansion of data collection should be approved by WooCommerce merchants. Let's at least be clear about this in the terms of service. Also, how do we surface this change in behavior to existing Jetpack and WooCommerce users? |
Pushing this to 4.5 since Pit Crew team is trying to get a beta out today. |
@gravityrail -- I'm taking this out of the current queue until Allen's concerns are reviewed/addressed |
Sure thing @samhotchkiss. Makes sense. |
@beaulebens has given go-ahead to merge this @samhotchkiss - adding back to 4.5 |
8bc726e
to
9141103
Compare
What is the plan to surface the expansion of data collection for WooCommerce merchants? |
The additional details will be included in the Jetpack support doc, which is what lets Jetpack users know what data is being synced. |
add_filter( 'jetpack_sync_before_enqueue_woocommerce_update_order_item', array( $this, 'filter_order_item' ) ); | ||
|
||
// order item meta | ||
$this->init_listeners_for_meta_type( 'order_item', $callable ); |
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 this use private $meta_types
?
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.
That variable is unused so I removed it.
merged to 4.5 44c43c3 |
CHangelog: add #5457 Changelog: add #5487 Changelog: add #5708 Changelog: add #5879 Changelog: add #5932 Changelog: add #5963 Changelog: add #5968 Changelog: add #5996 Changelog: add #5998 Changelog: add #5999 Changelog: add #6012 Changelog: add #6013 Changelog: add #6014 Changelog: add #6015 Changelog: add #6023 Changelog: add #6024 Changelog: add #6030 Changelog: add #5465 CHangelog: add #6063 Changelog: add #6025 Changelog: add #5974 Changelog: add #6059 Changelog: add #6046 Changelog: add #5418 Changelog: move things around and add missing information. Changelog: add #5565 Changelog: add #6087 Changelog: add #6095
Changelog: add #5867 Changelog: add #5874 Changelog: add #5905 Changelog: add #5906 Changelog: add #5931 Changelog: add #5933 Changelog: add #5934 Bring over 4.4.2 changelog from branch-4.4 @see 18012a3 Changelog: add #5976, #5978, #5983 Changelog: add #5917 Changelog: add #5832 Changelog: add 4.4.2 release post link. CHangelog: add #5457 Changelog: add #5487 Changelog: add #5708 Changelog: add #5879 Changelog: add #5932 Changelog: add #5963 Changelog: add #5968 Changelog: add #5996 Changelog: add #5998 Changelog: add #5999 Changelog: add #6012 Changelog: add #6013 Changelog: add #6014 Changelog: add #6015 Changelog: add #6023 Changelog: add #6024 Changelog: add #6030 Changelog: add #5465 CHangelog: add #6063 Changelog: add #6025 Changelog: add #5974 Changelog: add #6059 Changelog: add #6046 Changelog: add #5418 Changelog: move things around and add missing information. Changelog: add #5565 Changelog: add #6087 Changelog: add #6095 Readme: add @tyxla to the list of contributors. Improved changelog for your readability and enjoyment updated the release date finalizing the changelog with a few more edits
Syncs selected Woo data (order items and order item meta) to WPCOM using Jetpack Sync.
To test:
JETPACK_TEST_WOOCOMMERCE=1 phpunit --testsuite=sync --filter=WP_Test_Jetpack_Sync_WooCommerce