Jump to content

Change original .tpl through module


Recommended Posts

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} />
							{$gender->name}</label></div>
						{/foreach}
					</div>

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

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

 

Sorry for my bad english, thanks!

Link to comment
Share on other sites

http://developers.prestashop.com/themes/smarty/parent-child-feature.html

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.

Link to comment
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
×
×
  • Create New...