NEW : show product variants by default in product list#757
Closed
atm-corentin wants to merge 2 commits into
Closed
NEW : show product variants by default in product list#757atm-corentin wants to merge 2 commits into
atm-corentin wants to merge 2 commits into
Conversation
Add option PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST (Yes/No) in the variants module setup. When enabled, the "Show child products" checkbox of the products list (product/list.php) is ticked by default, so variant child products are visible without having to tick it manually. The default value keeps the current behaviour (variants hidden), so there is no regression for existing installs. The checkbox state is now always carried in the list parameters so an explicit "off" survives pagination and sorting even when the default is "on". Note: this is unrelated to PRODUIT_ATTRIBUTES_HIDECHILD, which only drives the product selectors, not the products list SQL query.
Author
|
Fermée : basée sur atm/develop (22.0.0-alpha, périmée). La feature reste livrée au client via la PR #758 (backport 23.0_ateliertortil). Une vraie contribution upstream sera reproposée sur origin/develop (v24) si besoin. |
atm-corentin
added a commit
that referenced
this pull request
Jul 16, 2026
- admin.php: wrap the set_const block with >>>/<<< BACKPORT markers (consistency) - admin.php: add missing 'int' 2nd param to GETPOST for the new const - ChangeLog: tag the entry as backport ATM #757 (native in Dolibarr 24.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contexte
Quand le module Variantes est actif, la liste des produits (
product/list.php) masque par défaut les produits enfants (variantes) viaAND pac.rowid IS NULL, tant que la case « Afficher les produits enfants » n'est pas cochée. Aucune option ne permettait de cocher cette case par défaut (la constante nativePRODUIT_ATTRIBUTES_HIDECHILDne pilote que les sélecteurs produit, pas le SELECT de la liste).Changement
Ajout de l'option
PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST(Oui/Non) dans le setup du module Variantes.L'état de la case est désormais toujours porté dans les paramètres de la liste, pour qu'un « décoché » explicite survive à la pagination et au tri même quand le défaut est « affiché ».
Fichiers
htdocs/product/list.php— résolution du défaut (parse + reset) + carry du paramètrehtdocs/variants/admin/admin.php— nouvelle option Oui/Nonhtdocs/langs/en_US/products.lang— clésShowProductCombinationsInList(+Help)ChangeLogTests
php -lOK sur les fichiers modifiés$show_childproducts: 9 scénarios OK (défaut, coche explicite, recherche box décochée, reset, survie pagination on/off)🤖 Generated with Claude Code