Use Hooks?

OK. In the file profile_fields.tpl I want to change the line



{assign var="disabled_param" value=""}
{assign var="_class" value=""}
{* DAVID MOD - Add below line*}
{assign var="hide_fields" value=true}

This will Force Ship to Billing address. It works perfectly.

But how do I do this using hooks, I do not see any hooks in that file to use?

Currently I have modified the original file, but want to do it correctly to prevent upgrade overwriting my changes.

You would have to replace the whole template with an override for that template. You can find the path to use documented in the addon developer KB. I don't remember what it is off the top of my head, but essentially it will replace that template with yours. Note that any future upgrade changes to that template should be reviewed. So suggest you add a comment to the original so that it generates a conflict during upgrade if it's changed. You can then review the differences.


I was hoping something got better in 4.x. Now I remember why I haven't used in hooks in the previous versions. They work well for styles, but not real changes.


I disagree. You can't put a hook in for every input field. Have you requested they add a hook to that template for future? You could then just add your own and use it.