hhcj Posted October 21, 2016 Share Posted October 21, 2016 Hello, Sorry for my English. I'm newbie how developer prestashop and have a dude. I have a module that write a variable in a hook of product.tpl. But i want use there variable in other templates like product_list.tpl Example: this code are in module tpl {assign var="maximo" value="0"} {assign var="minimo" value="10000"} {foreach from=$product_retailers item=retailer} {if $retailer.price > $maximo} {assign var="maximo" value=$retailer.price} {/if} {if $retailer.price < $minimo} {assign var="minimo" value=$retailer.price} {/if} {/foreach} and i want use this code in product-list.tpl Its possible? Link to comment Share on other sites More sharing options...
razaro Posted October 21, 2016 Share Posted October 21, 2016 Check this tutorial http://nemops.com/prestashop-product-rating-product-list/ . It shows how to ad custom hook in product-list.tpl. It is for older version but still works in 1.6. 1 Link to comment Share on other sites More sharing options...
hhcj Posted October 26, 2016 Author Share Posted October 26, 2016 Thank you Razaro, thank you very much. I will explain how I fix. i installed next module https://mypresta.eu/modules/administration-tools/hooks-manager.html in controller of module i created new function for register my hook with params. Because its different call hook from product.tpl or product_list.tpl in product.tpl {hook h="prices_retailers" idproduct="{$product->id|intval}"} in product_list.tpl {hook h="prices_retailers" idproduct=$product.id_product} And works fine!!! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now