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

Limit WooCommerce integration with ability to allow it #2914

Closed
wants to merge 13 commits into from

Conversation

MARQAS
Copy link
Contributor

@MARQAS MARQAS commented Aug 1, 2022

Description of the Change

Filter to allow WooCommerce. It will limit the usage of WooCommerce integration to the places where it is actually needed.

Closes #2809

How to test the Change

Changelog Entry

Added - Filter to allow/limit WooCommerce integration
Changed - should_integrate_with_query function

Credits

Props @MARQAS

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@MARQAS MARQAS self-assigned this Aug 1, 2022
@MARQAS MARQAS added this to the 4.3.0 milestone Aug 1, 2022
@MARQAS MARQAS requested a review from felipeelia August 1, 2022 18:45
@MARQAS MARQAS marked this pull request as ready for review August 3, 2022 16:03
@MARQAS MARQAS assigned felipeelia and MARQAS and unassigned MARQAS Aug 3, 2022
@felipeelia felipeelia removed their assignment Aug 8, 2022
@felipeelia felipeelia assigned felipeelia and unassigned MARQAS and felipeelia Aug 16, 2022
@MARQAS MARQAS assigned MARQAS and felipeelia and unassigned MARQAS Aug 22, 2022
includes/classes/Feature/WooCommerce/WooCommerce.php Outdated Show resolved Hide resolved
includes/classes/Feature/WooCommerce/WooCommerce.php Outdated Show resolved Hide resolved
includes/classes/Feature/WooCommerce/WooCommerce.php Outdated Show resolved Hide resolved
tests/php/features/TestWooCommerce.php Outdated Show resolved Hide resolved
tests/php/features/TestWooCommerce.php Outdated Show resolved Hide resolved
@felipeelia
Copy link
Member

@MARQAS before we merge this one we will need a list of real scenarios where we would expect the feature to integrate or not with Elasticsearch. Then that will need to become proper tests. Can you please work on that? Thanks.

@felipeelia felipeelia assigned MARQAS and unassigned felipeelia Aug 24, 2022
@felipeelia felipeelia modified the milestones: 4.3.0, 4.4.0 Aug 24, 2022
@oscarssanchez
Copy link
Contributor

f66b880 looks good but am not sure if the two instances of ep_integrate removed from tests is all we need. Did we create the list of scenarios @MARQAS ?

@felipeelia felipeelia assigned MARQAS and unassigned felipeelia and oscarssanchez Oct 12, 2022
@felipeelia
Copy link
Member

@MARQAS I've created a new sheet in our doc with a format I think will make things easier for us to understand. Can you please let me know when you have that completely filled? Feel free to add any new lines/scenarios you think I missed.
After we have that complete, we can plan to write tests for each scenario. Thanks!

@felipeelia felipeelia modified the milestones: 4.4.0, 4.5.0 Nov 1, 2022
@MARQAS MARQAS assigned felipeelia and unassigned MARQAS Dec 13, 2022
*/
if ( defined( 'WC_API_REQUEST' ) && WC_API_REQUEST ) {
return false;
if ( method_exists( $query, 'is_search' ) && ! $query->is_search() && empty( $query->query_vars['s'] ) ) {
Copy link
Member

Choose a reason for hiding this comment

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

[question] The is_search() method is available since WP 3.1.0. Is there any reason why we are checking if it exists?

* @hook ep_woocommerce_integration
* @param {bool} $allow True to allow ep integration
* @param {WP_Query} $query WP Query to evaluate
* @since 4.4.0
Copy link
Member

Choose a reason for hiding this comment

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

We will need to update this to 4.5.0

@felipeelia felipeelia removed their assignment Jan 24, 2023
@felipeelia
Copy link
Member

Closing this in favor of (the already merged) #3259

@felipeelia felipeelia closed this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit WooCommerce integration
4 participants