en Jump to content
  • 0

Change original .tpl through module


Hello all, I'm a newcomer to this forum.

I have some basic piece of code my first module, which has the ability to enable / disable the display of the title in the customer account registration. Switching the hide option in the administration works.

However, my question of her:

How do I modify the original prestashop file order-opc-new-account.tpl for hide this code from the form called from my module without modifying original files?

					<div class="required clearfix gender-line">
						<label>{l s='Social title'}</label>
						{foreach from=$genders key=k item=gender}
						<div class="radio-inline">
							<label for="id_gender{$gender->id_gender}" class="top">
							<input type="radio" name="id_gender" id="id_gender{$gender->id_gender}" value="{$gender->id_gender}"{if isset($smarty.post.id_gender) && $smarty.post.id_gender == $gender->id_gender || (isset($guestInformations) && $guestInformations.id_gender == $gender->id_gender)} checked="checked"{/if} />

through a module based on ORDERS_SOCIALTITLE boolean, which will be TRUE

Code: https://pastebin.com/raw/km42mJv6


Sorry for my bad english, thanks!

Share this post

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You mean, w/o modifying the original tpl file ? You can create a child theme, copy the original tpl in the child theme and modify it.

Share this post

Link to post
Share on other sites
  • 0
Yes, I need to edit the .tpl file that is part of the prestashop through the module. Specifically, hide the gender field of the customer. How can I do it? How can I create child theme in module?
Edited by FilipHavlicek

Share this post

Link to post
Share on other sites
  • 0


Once you've created the theme, you simply copy the .tpl that you want to modify in your child theme, using the same directory structure as the parent theme. PS will then use your modified tpl. Don't forget to force recompilation of template (BO > Advanced parameters > Performance...).

Beware that the cache files will be created within your child theme directories.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More