NEW : show product variants by default in product list (backport)#758
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.
atm-vincent-p
left a comment
There was a problem hiding this comment.
Plusieurs GetPost sans le deuxième paramètre, mais possibilité d'y outre passé car backport
| NEW: Add MULTICURRENCY_SHOW_ALSO_MAIN_CURRENCY_ON_PDF for legal requirement that need both currencies on PDF | ||
| NEW: Add note public and private on order export | ||
| NEW: Finish dev for API_ENABLE_COUNT_CALLS (count of API use is visible on user API key field) | ||
| NEW: Add option PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST to show product variants by default in the products list |
There was a problem hiding this comment.
Le ChangeLog Dolibarr ne date pas les lignes individuelles (regroupement par version). J'ai plutôt tagué l'entrée comme backport, conforme aux autres (backport ...) du fichier : ... (backport ATM #757, native in Dolibarr 24.0). Corrigé.
| // BACKPORT ATM #757 - natif dès Dolibarr 24.0, à retirer après upgrade vers 24+ | ||
| if (!dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST', GETPOST('PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST'), 'chaine', 0, '', $conf->entity)) { | ||
| setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); | ||
| $error++; | ||
| } | ||
|
|
There was a problem hiding this comment.
Backport Start et End ou équivalent
There was a problem hiding this comment.
Fait : bloc encadré par // >>> BACKPORT ATM #757 / // <<< BACKPORT ATM #757, comme le bloc d'affichage plus bas.
| } | ||
|
|
||
| // BACKPORT ATM #757 - natif dès Dolibarr 24.0, à retirer après upgrade vers 24+ | ||
| if (!dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST', GETPOST('PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST'), 'chaine', 0, '', $conf->entity)) { |
There was a problem hiding this comment.
Manque du second paramètre de getpost, mais on passe car backport
There was a problem hiding this comment.
Ajouté : GETPOST('PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST', 'int') (la valeur vient d'un selectyesno -> 0/1).
- 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)
Backport vers 23.0_ateliertortil
Backport de #757 (branche
develop).Contexte (ticket client)
Suite à la montée v17 → v23, le client signale des produits « manquants » dans la liste (ex.
ASAMA-HT-00084,AEROLITE-HT-00318,KAZAN-HT-00091). Diagnostic : ces produits existent mais sont des variantes enfants, masquées par défaut dans la liste produit tant que la case « Afficher les produits enfants » n'est pas cochée (comportement natif du module Variantes). Rien à voir avec la liaison Splash/Akeneo.Changement
Ajout de l'option
PRODUIT_ATTRIBUTES_SHOWCHILD_IN_LIST(Oui/Non) dans le setup du module Variantes.L'état de la case est toujours porté dans les paramètres de la liste (survit à la pagination/tri).
Activation côté client
Configuration > Modules > Variantes de produit → « Afficher les variantes par défaut dans la liste produit » = Oui.
Tests
php -lOK$show_childproducts: 9 scénarios OK🤖 Generated with Claude Code