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

Integrate WooCommerce with Jetpack Sync #5708

Merged
merged 6 commits into from
Jan 4, 2017
Merged

Conversation

gravityrail
Copy link
Contributor

@gravityrail gravityrail commented Nov 17, 2016

Syncs selected Woo data (order items and order item meta) to WPCOM using Jetpack Sync.

To test:

  • ensure there is a checkout of the WooCommerce plugin in the same directory as the Jetpack plugin. This needs to be the original source, not the published plugin, so that it includes test files.
  • Run JETPACK_TEST_WOOCOMMERCE=1 phpunit --testsuite=sync --filter=WP_Test_Jetpack_Sync_WooCommerce

@@ -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' ) );
Copy link
Contributor

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?

Copy link
Contributor Author

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?

@gravityrail gravityrail added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Nov 18, 2016
@gravityrail gravityrail changed the title Initial implementation of WooCommerce integration with Sync Integrate WooCommerce with Jetpack Sync Nov 18, 2016
@allendav
Copy link
Contributor

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?

@ebinnion ebinnion modified the milestones: 4.5, 4.4.2 Nov 30, 2016
@ebinnion
Copy link
Contributor

Pushing this to 4.5 since Pit Crew team is trying to get a beta out today.

@samhotchkiss samhotchkiss modified the milestones: Not Currently Planned, 4.5 Dec 8, 2016
@samhotchkiss
Copy link
Contributor

@gravityrail -- I'm taking this out of the current queue until Allen's concerns are reviewed/addressed

@gravityrail
Copy link
Contributor Author

Sure thing @samhotchkiss. Makes sense.

@gravityrail
Copy link
Contributor Author

@beaulebens has given go-ahead to merge this @samhotchkiss - adding back to 4.5

@gravityrail gravityrail modified the milestones: 4.5, Not Currently Planned Jan 3, 2017
@lezama lezama force-pushed the add/woocommerce-sync branch from 8bc726e to 9141103 Compare January 3, 2017 17:43
@jeffstieler
Copy link
Contributor

What is the plan to surface the expansion of data collection for WooCommerce merchants?

@samhotchkiss @beaulebens

@beaulebens
Copy link
Member

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 );
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@gravityrail gravityrail merged commit d738e85 into master Jan 4, 2017
@gravityrail gravityrail deleted the add/woocommerce-sync branch January 4, 2017 21:16
@gravityrail gravityrail removed the [Status] Needs Review This PR is ready for review. label Jan 4, 2017
@dereksmart dereksmart restored the add/woocommerce-sync branch January 5, 2017 14:33
@dereksmart
Copy link
Member

merged to 4.5 44c43c3

@dereksmart dereksmart deleted the add/woocommerce-sync branch January 5, 2017 14:34
jeherve added a commit that referenced this pull request Jan 9, 2017
dereksmart pushed a commit that referenced this pull request Jan 17, 2017
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
dereksmart pushed a commit that referenced this pull request Jan 17, 2017
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants