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

Stops working with number of variations over 30 #12

Open
yakovsh opened this issue Mar 10, 2021 · 1 comment
Open

Stops working with number of variations over 30 #12

yakovsh opened this issue Mar 10, 2021 · 1 comment

Comments

@yakovsh
Copy link
Contributor

yakovsh commented Mar 10, 2021

Original issue here:
https://wordpress.org/support/topic/wc-external-variations-an-error-has-occured-see-console/

Root cause is the fact that WooCommerce doesn't export variation data over 30 and uses AJAX instead to load it from the server:
https://github.com/woocommerce/woocommerce/blob/trunk/includes/wc-template-functions.php#L1668
https://wordpress.org/support/topic/woocommerce-data-product_variationsfalse-doesnt-show-autmatically/

$get_variations = count( $product->get_children() ) <= apply_filters( 'woocommerce_ajax_variation_threshold', 30, $product );

@yakovsh
Copy link
Contributor Author

yakovsh commented Mar 10, 2021

For now, will document this and point users to a workaround using the "woocommerce_ajax_variation_threshold" filter:
https://docs.woocommerce.com/document/change-limit-on-number-of-variations-for-dynamic-variable-product-dropdowns/

yakovsh pushed a commit that referenced this issue Mar 10, 2021
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

No branches or pull requests

1 participant