-
Notifications
You must be signed in to change notification settings - Fork 3
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
Added option to get variations with stock 0 in feed + new query #57
Conversation
@jeremykervran Je vois que De notre côté, si la personne à choisis d'avoir toutes les variations même avec un stock à zéro on pourrait utiliser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremykervran Il faudrait qu'on se repose sur la PR pour voir. Je me demande si ça n'ajoute pas un effet de bord l'ajout du paramètre $for_feed
.
TODO: rebase |
b8d017c
to
5dfd36e
Compare
19dc228
to
56626f9
Compare
413fc14
to
bc6d93d
Compare
Ensure out of stock products (simple and variation) are not included in the feed by default. Rework the new option to control both simple and variations products in the feed.
Je pense qu'on a pas d'autre choix que de faire une query custom pour gérer les variations à stock 0 dans le flux, à cause du fonctionnement de base de WC qui base tout sur une option : https://woocommerce.github.io/code-reference/files/woocommerce-includes-class-wc-product-variable.html#source-view.302
Modifier cette option à la volée entrainerait trop d'effets de bords possibles.
Y'a potentiellement mieux que la WP_Query que je fais dans get_all_product_variations( $product ) - src/Products/Product.php ligne 454, en passant par une WC_Query peut-être ?
Mais en l'état ça marche :
21 0 // STOCK A ZERO QUI REMONTE 10.00 8.00 variation-1