-
Notifications
You must be signed in to change notification settings - Fork 303
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 param product_count_visible_only loop category #2356
Conversation
* @return int | ||
*/ | ||
public function countAllProductsVisibleOnly() | ||
{ |
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.
Au lieu de recopier la fonction countAllProducts()
pour juste ajouter le filtre par visibilité, il vaut mieux ajouter à countAllProducts()
un paramètre visibleOnly
qui est false par defaut. On ajoute le filtre par visibilité si ce paramètre est true.
Du coup, on aurait :
public function countAllProductsVisibleOnly() {
return countAllProducts(true);
}
Plus de recopie de code :)
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.
j'ai modifié
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.
Merci ! Peux-tu rebaser ?
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.
je ne suis pas sur que cela ait marché
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.
On dirait que si :)
To match the doc -> loop category add param 'product_count_visible_only' if 'need_product_count' and 'product_count_visible_only' are true 'PRODUCT_COUNT' return only the visible products
Merci 👍 |
De rien :) |
To match the doc -> loop category
add param 'product_count_visible_only'
if 'need_product_count' and 'product_count_visible_only' are true
'PRODUCT_COUNT' return only the visible products