Hooks are not always unique

I wanted my own implementation for the cart content dropdown list. Use different stylesheet if the price is above €70,-.



In skins/basic/customer/blocks/cart_content.tpl i found {hook name=“wrapper:onclick_dropdown_title”} surrounding the code which i need to alter. So i create a onclick_dropdown_title.override.tpl and placed it in my_changes/hooks/wrapper.



This had the side effect that not only the cart content changed but also the account dropdown, Futher inverstigation showed {hook name=“wrapper:onclick_dropdown_title”} is also used in skins/basic/customer/blocks/wrappers/onclick_dropdown.tpl.



Again i have to change the original tpl file to get desired results.

Bracket your changes in some unique product value from the block. I.e. something like:

{if $smarty.session.cart.products}
Do the custom code
{else}
Do the standard code
{/if}


There may be different (more appropriate values to compare against, but you get the idea…

Thx for the reply. I added the functionalty directly in the template file. Just wanted to report the [color=#282828][font=arial, verdana, tahoma, sans-serif] {hook name=“wrapper:onclick_dropdown_title”} is used in two places and thus not unique[/font][/color]

Many hooks are not unique. I look at it as a feature (code reuse)… Since most times when someone wants to change the layout of an element or chunk of html, they want to do it for all elements/html with equivalent functionality. Key is “most times”…

I was under the impression the hook names were unique. So this is no issue and topic can be closed