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

Add filter for skipping validation of catalog visibility #2079

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

lxbdr
Copy link

@lxbdr lxbdr commented Sep 16, 2021

Add filter "wc_facebook_validate_product_visibility" to optionally skip the validation of product visibility in catalog and search results.

  • Do the changed files pass phpcs checks? Please remove phpcs:ignore comments in changed files and fix any issues, or delete if not practical.

Changes proposed in this Pull Request:

Some plugins like "WooCommerce Single Variations" by IconicWP allow single variations to show up in the catalog. Therefore a common use case is to show a handful of variations in the catalog and hide the parent product from catalog and search results. This prevents the variable product altogether from syncing as the product is validated and part of this validation is whether the product is visible in catalog and search results.

As the hard criteria whether a product is included / synced is the post status and additional exclusion rules by taxonomy, the catalog visibility should be optional.

How to test the changes in this Pull Request:

  1. Exclude a product from catalog in product edit screen
  2. Sync to Facebook, see the product is not synced
  3. Add e.g. add_filter('wc_facebook_validate_product_visibility', '__return_false', 10); to functions.php
  4. Sync to Facebook, confirm the product is synced again

Changelog entry

New - Add filter "wc_facebook_validate_product_visibility"

Add filter "wc_facebook_validate_product_visibility" to optionally skip the validation of product visibility in catalog and search results.
@rawdreeg rawdreeg changed the base branch from master to develop June 3, 2022 11:34
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.

1 participant