Hi,
That code should still work the same with the latest version.
in fact, you can add that code in the file "show" of the view "product" just after the first <?php and it should work there too. And would avoid having to do the change on each update.