Skip to content

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

Merged
Codencode merged 2 commits into
PrestaShop:devfrom
Codencode:contactform-hide-subject-when-single-contact
Feb 25, 2026
Merged

ContactForm: Hide subject dropdown when only one contact is available#88
Codencode merged 2 commits into
PrestaShop:devfrom
Codencode:contactform-hide-subject-when-single-contact

Conversation

@Codencode

@Codencode Codencode commented Feb 12, 2026

Copy link
Copy Markdown
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

NOTE:
If you are using the classic theme, delete (or rename) the file
themes/classic/modules/contactform/views/templates/widget/contactform.tpl.
If you are using the hummingbird theme, do the same.
This is essential to see the modification.
Related PRs PrestaShop/hummingbird#932
PrestaShop/classic-theme#201

Before

Before

After

After

Note

If this PR is approved, I will update the modules/contactform/views/templates/widget/contactform.tpl file in both the classic and hummingbird themes accordingly.

@ps-jarvis

Copy link
Copy Markdown

Hello @Codencode!

This is your first pull request on contactform repository of the PrestaShop project.

Thank you, and welcome to this Open Source community!

@github-project-automation github-project-automation Bot moved this to Ready for review in PR Dashboard Feb 12, 2026
@Codencode
Codencode requested review from a team, Hlavtox, Touxten and kpodemski February 12, 2026 08:49
Hlavtox
Hlavtox previously approved these changes Feb 12, 2026
Touxten
Touxten previously approved these changes Feb 12, 2026

@Touxten Touxten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logic

@Codencode
Codencode dismissed stale reviews from Touxten and Hlavtox via 2dde702 February 12, 2026 15:29
@Codencode
Codencode requested review from Hlavtox and Touxten February 12, 2026 15:30
@Codencode

Copy link
Copy Markdown
Contributor Author

@kpodemski
there's a compatibility issue with PHP here, similar to this other PR: PrestaShop/ps_socialfollow#51
However, my PR didn't touch the contactform.php file.
Fixing this issue is relatively simple, so do you think I should fix it? Or should we leave it as is?

Thanks

@tblivet tblivet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry, I didn’t see the question about the CI break!
Any thoughts on this? @kpodemski

@Touxten Touxten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok for CI it's for all native module

@Touxten Touxten closed this Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from Ready for review to Closed in PR Dashboard Feb 25, 2026
@Touxten Touxten reopened this Feb 25, 2026
@github-project-automation github-project-automation Bot moved this from Closed to Reopened in PR Dashboard Feb 25, 2026
@SiraDIOP SiraDIOP self-assigned this Feb 25, 2026

@SiraDIOP SiraDIOP left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hello @Codencode,

Thanks for your PR , i tested it but i don't have the same result

Enregistrement.de.l.ecran.2026-02-25.a.17.26.54.mov

Did i miss something?

Thank you

@Codencode

Codencode commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

Hello @SiraDIOP,
you have deleted/renamed the file: themes/classic/modules/contactform/views/templates/widget/contactform.tpl

@SiraDIOP SiraDIOP left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Codencode My bad thank you

It's good for me

Image

Thank you

@SiraDIOP SiraDIOP added QA ✔️ Status: Check done, Code approved and removed waiting for QA labels Feb 25, 2026
@Codencode
Codencode merged commit 8351f97 into PrestaShop:dev Feb 25, 2026
40 of 46 checks passed
@github-project-automation github-project-automation Bot moved this from Reopened to Merged in PR Dashboard Feb 25, 2026
@Codencode
Codencode deleted the contactform-hide-subject-when-single-contact branch February 25, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QA ✔️ Status: Check done, Code approved

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants