Astolfo Posted December 14, 2020 Share Posted December 14, 2020 I'm tryng to display small icon with this hook, but it's displaying icon many time instead of spaces.Maybe someone knows what the problem? Link to comment Share on other sites More sharing options...
ClassyDevs Posted December 14, 2020 Share Posted December 14, 2020 Hello, which PrestaShop you are using, can you upload image image how it looks.. So that we can give you a proper suggestion Thank you Link to comment Share on other sites More sharing options...
Astolfo Posted December 14, 2020 Author Share Posted December 14, 2020 I'm using Prestashop 1.7 public function install() { include(dirname(__FILE__).'/sql/install.php'); return parent::install() && $this->registerHook('header') && $this->registerHook('backOfficeHeader') && $this->registerHook('displayProductPriceBlock'); } - registering hook; public function hookDisplayProductPriceBlock($params) { return $this->display(__FILE__, 'display_product_price_block.tpl'); } - hook function <form action='../modules/wishlist/addtowishlist.php' method='POST'> <input type='text' value='' style='display:none'> <button type='submit'>🖤</button> </form> - tpl file Output: Link to comment Share on other sites More sharing options...
ClassyDevs Posted December 15, 2020 Share Posted December 15, 2020 (edited) Hello, After investigate many things. i found that if we hook it in hookDisplayProductPriceBlock then it show multiple times. we need to add some kind of condition to limit it. It show after before price one time. if ( $hookName == 'displayProductPriceBlock' && $params['type'] != 'before_price') { return false; } I suggest you to use this in new hook displayProductListReviews then you are able to use this nicely, It used same way how review show. Normally the possition it using css. I have put the css with template for you. Bellow is screen shot how it will show after we do this. https://pscreenshot.com/i/APaS18 <style type="text/css"> .product-list-wishlist { border: 1px solid red; position: absolute; top: -26px; display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: center; width: 100%; background: rgba(255, 255, 255, 0.5); padding: 4px 0; } </style> <div class="product-list-wishlist"> <form action='../modules/wishlist/addtowishlist.php' method='POST'> <input type='text' value='' style='display:none'> <button type='submit'>🖤</button> </form> </div> Hope your issue will sovled. Thank you Classy Devs Team Edited December 15, 2020 by ClassyDevs (see edit history) 2 Link to comment Share on other sites More sharing options...
Astolfo Posted December 15, 2020 Author Share Posted December 15, 2020 It's working for me. Thank you Link to comment Share on other sites More sharing options...
ClassyDevs Posted December 15, 2020 Share Posted December 15, 2020 Glad to know it works. Do not forgot to mark the post as solved and like our solution Thank you 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