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

WooCommerce weight by date #3462

Merged
merged 13 commits into from
Jun 7, 2023
Merged

Conversation

MARQAS
Copy link
Contributor

@MARQAS MARQAS commented May 16, 2023

Description of the Change

This PR will add two options to control the weighting in the search results for products. One will disable the weighting only for the product queries and the other will disable the weighting on any query that includes products.

Closes #3177

How to test the Change

  • Enable the WooCommerce feature
  • Notice that the Weight results by date settings will now have two additional options in it
  • Select the third option (Disable for products) and search for a product on the products page(admin) and note that it will not have weighting. Normal search will have weighting even if it contains products in it.
  • Select the 4th option(Disable Weighting in any query that includes products) and search for a product and note that it will not have weighting. Any query that has a post-type product in it will not have the weighting args.
  • Selecting the 2nd option will disable it for any search you make.

Changelog Entry

Added - Two new options for Weight results by date to manage weighting for product post-types

Credits

Props @MARQAS @felipeelia

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 added this to the 5.0.0 milestone May 16, 2023
Copy link
Member

@felipeelia felipeelia left a comment

Choose a reason for hiding this comment

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

We'll need to separate concerns a bit better here before we can merge it @MARQAS. Perhaps a filter in Search that is used by WooCommerce is all you really need. I'm also not sure how this change interferes with regular weighting.

includes/classes/Feature/Search/Search.php Outdated Show resolved Hide resolved
includes/classes/Feature/Search/Search.php Outdated Show resolved Hide resolved
includes/classes/Feature/Search/Search.php Outdated Show resolved Hide resolved
includes/classes/Feature/Search/Weighting.php Outdated Show resolved Hide resolved
includes/classes/Feature/Search/Weighting.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/TestSearch.php Outdated Show resolved Hide resolved
tests/php/features/TestSearch.php Outdated Show resolved Hide resolved
tests/php/features/TestSearch.php Outdated Show resolved Hide resolved
@felipeelia felipeelia modified the milestones: 5.0.0, 4.6.0 May 19, 2023
includes/classes/Feature/Search/Search.php Outdated Show resolved Hide resolved
includes/classes/Feature/Search/Weighting.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/TestSearch.php Outdated Show resolved Hide resolved
Copy link
Contributor

@burhandodhy burhandodhy left a comment

Choose a reason for hiding this comment

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

LGTM

@felipeelia felipeelia merged commit 84171fd into develop Jun 7, 2023
@felipeelia felipeelia deleted the feature/3177-woocommerce-weight-by-date branch June 7, 2023 19:45
felipeelia added a commit that referenced this pull request Jun 7, 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.

Weight results by date and WooCommerce Products
3 participants