Skip to content

ContactForm: Hide subject dropdown when only one contact is available#932

Merged
Touxten merged 2 commits intoPrestaShop:2.xfrom
Codencode:contactform-hide-subject-when-single-contact
Feb 17, 2026
Merged

ContactForm: Hide subject dropdown when only one contact is available#932
Touxten merged 2 commits intoPrestaShop:2.xfrom
Codencode:contactform-hide-subject-when-single-contact

Conversation

@Codencode
Copy link
Contributor

Questions Answers
Description? When only one contact is available in the Contact Form module, the subject dropdown is no longer displayed.
Instead of rendering a <select> with a single option, the module now automatically sets the id_contact value using a hidden input.
This improves the user experience by removing an unnecessary selection while preserving the expected form behavior.
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket?
How to test? - In the admin panel, go to Shop Parameters > Contact
- Delete the contacts, leaving only one
- In the front office, go to the Contact page
- The Subject Heading label and its related select dropdown should not be displayed
Related PRs PrestaShop/contactform#88

Before

Hummingbird-before

After

Hummingbird-after

@Codencode Codencode added the Improvement Enhances existing features or code. label Feb 12, 2026
@github-project-automation github-project-automation bot moved this to Ready for review in PR Dashboard Feb 12, 2026
Touxten
Touxten previously approved these changes Feb 12, 2026
Copy link
Contributor

@tblivet tblivet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Codencode, thanks for the PR just a few changes and I think you should target the 2.x branch 👍

@Codencode Codencode force-pushed the contactform-hide-subject-when-single-contact branch from 56ba249 to dfea5fe Compare February 12, 2026 15:16
@Codencode Codencode changed the base branch from develop to 2.x February 12, 2026 15:16
@Codencode Codencode requested review from Touxten and tblivet February 12, 2026 15:16
@Codencode
Copy link
Contributor Author

Codencode commented Feb 12, 2026

@tblivet

I switched branch and added the escape statement, but I can't change the code to retrieve the single contact, because $contact uses id_contact as indices, that's why I use current().

@Codencode Codencode force-pushed the contactform-hide-subject-when-single-contact branch from d34ea3f to 88f392a Compare February 13, 2026 09:33
@Codencode Codencode requested a review from tblivet February 13, 2026 09:41
Copy link
Contributor

@tblivet tblivet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Codencode 👍

@ps-jarvis ps-jarvis moved this from Ready for review to To be tested in PR Dashboard Feb 13, 2026
@ingridusta ingridusta self-assigned this Feb 17, 2026
Copy link

@ingridusta ingridusta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Codencode,

I tested your pr and it works as expected. When 1 contact only remains, heading 'Subject' is not displayed anymore.

Image

I also created back contacts, and heading 'Subject' is displayed back.

Image

Thanks, it's QA approved !

@ingridusta ingridusta removed their assignment Feb 17, 2026
@Codencode Codencode added this to the v2.0.0 milestone Feb 17, 2026
@Codencode
Copy link
Contributor Author

@tblivet can I merge this PR? Or should we wait for the module PR to be merged first?

@tblivet
Copy link
Contributor

tblivet commented Feb 17, 2026

@Codencode I think this can be merged 👍

@tblivet tblivet modified the milestones: v2.0.0, v2.0.1 Feb 17, 2026
@Touxten Touxten merged commit 355bd71 into PrestaShop:2.x Feb 17, 2026
6 checks passed
@github-project-automation github-project-automation bot moved this from To be tested to Merged in PR Dashboard Feb 17, 2026
@Touxten
Copy link
Contributor

Touxten commented Feb 17, 2026

Thank you @Codencode && @tblivet

@Codencode Codencode deleted the contactform-hide-subject-when-single-contact branch February 17, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Enhances existing features or code. QA ✓

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants