Need A Hook In Product Update.tpl

Our store has products which have lots of related part numbers. we want to add that to the product admin UI. I was able to edit and add a hook definition between the product Code and price entries.



could this get added to the product? (I did this manually for 4.2.4 and 4.3.1)



thanks.



Sam

If you check built-in addons, you can find that you can add data to the Addons tab. Also each module can have own tab with the required data.

Hi Sam, If you needed in that position, “[color=#282828][font=arial, verdana, tahoma, sans-serif]between the product Code and price entries[/font][/color]” you will need to override the product update tpl and add your own hook there and after that you can use that new hook created



To override file you just need to add



#file

design/backend/templates/addons/my_changes/overrides/views/products/update.tpl
```<br />
<br />
#add the content from<br />
```php
design/backend/templates/views/products/update.tpl
```<br />
<br />
#add new hook where you need<br />
```php
<br />
{hook name="products:my_new_hook"}{/hook}<br />

```<br />
<br />
My Changes add-on is required to be active for this to work.<br />
<br />
The only ugly part is on upgrade you need to check if [b]design/backend/templates/views/products/update.tpl[/b] is changed for you to update you override files as well but the hook will need no modifications <img src="upload://ssa1U17ndImgNZSdwFNmOF2yUgM.png" class="bbc_emoticon" alt=";)"><br />
<br />
<br />
I hope that helps,<br />
<br />
[color=#282828][font=arial, verdana, tahoma, sans-serif]---[/font][/color]<br />
[color=#282828][font=arial, verdana, tahoma, sans-serif]Valentin[/font][/color]<br />
[color=#808080][font=arial, verdana, tahoma, sans-serif][size=2]part of hungryweb.net[/size][/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]

Thanks Vali!.. I didn't realize there was override like this… where is this all documented?



very easy to fix my code… I check for update.tpl to contain my hook already, just need to copy it to the overrides location…

done…



but… I notice that my_addon/init.php is called on EVERY transaction!.. is that true?

[quote name='sdetweil' timestamp='1431520570' post='214247']

but… I notice that my_addon/init.php is called on EVERY transaction!.. is that true?

[/quote]



Yes, this is common file for all pages. If you want any code to be run for the specific pages only, please list them here. I or Vali will help you.

thanks… I moved my setup code to the func.php and call it from the addon.xml functions for=install block…



works great