fkaus Posted September 18, 2015 Share Posted September 18, 2015 (edited) Hi, Can someone please help with the blocklayered module. I have tried everything found on the net, but still cant figure out the issue. I am using a customed theme and have hooked the module on top of categories. It is appearing, but not eveything is present and neither is the filter working. Your help will be much appreciated Please see attched screenshot. Thank you. Edited September 18, 2015 by fk_0786 (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted September 18, 2015 Share Posted September 18, 2015 The native blocklayered module is not intended for to hook on top. If you added this functionality by yourself, you also should add an own css to the module. Which version of blocklayered are you using ? The last both versions have a bug: http://forge.prestashop.com/browse/NM-642 You can download latest version of working blocklayered module, so without bugs here in my contributio on Prestashop Portuguese Forum: https://www.prestashop.com/forums/index.php?app=core&module=attach§ion=attach&attach_id=134284 Version of the module is 2.0.7. Link to comment Share on other sites More sharing options...
fkaus Posted September 18, 2015 Author Share Posted September 18, 2015 (edited) Hi, The version im using is v2.1.2 I downloaded the latest version from the link you provided, can you please advise how to integrate it to my site. Yes, i did add my own css as below: #center_column .layered_filter{ float:left; width: 50%; } #center_column .layered_filter:nth-child(2n) { clear:left; } #layered_block_left div.filtr_type_weight, #layered_block_left div.filtr_type_price { float: left; width: 50%; } #layered_block_left div.filtr_type_manufacturer li { float: left; height: 18px; width: 25%; } Also as you can see on the screenshot, no colors anything are appearing. I dont understand why. Thank you Edited September 18, 2015 by fk_0786 (see edit history) Link to comment Share on other sites More sharing options...
fkaus Posted September 18, 2015 Author Share Posted September 18, 2015 ok I have replace everything under module > blocklayered with the content of the zip file. But still nothing. Can you please help @selectshop.at Thank you Link to comment Share on other sites More sharing options...
selectshop.at Posted September 18, 2015 Share Posted September 18, 2015 (edited) The replace of the module will not take effect to your problem, but it will correct the bug the module has. As I told you, the module is not coded for to hook into category top. This module hooks only on left/right block side. The module I passed you is one without bugs, cause the latest two Prestashop upgraded, they have a filtering bug. Edited September 18, 2015 by selectshop.at (see edit history) Link to comment Share on other sites More sharing options...
fkaus Posted September 18, 2015 Author Share Posted September 18, 2015 Ok thanks, i reverted back to v2.07 as you requested. Can you please help with the issues im having? thanks Link to comment Share on other sites More sharing options...
fkaus Posted September 18, 2015 Author Share Posted September 18, 2015 I have followed the tutorial to hook the module on top: http://nemops.com/prestashop-layered-navigation-block-center-column/#.Vfq0D9LtlBe As seen on the screenshot, it's looking good. But i dont understand why it's not displaying properly, colors, style and all are not appearing and also its not filtering when the checkbox is checked. Link to comment Share on other sites More sharing options...
fkaus Posted September 19, 2015 Author Share Posted September 19, 2015 Can someone please help or maybe suggest me a forum where my queries can be answered? Thank you. Link to comment Share on other sites More sharing options...
razaro Posted September 21, 2015 Share Posted September 21, 2015 It is hard to say as you are working on local server. Check if module is hooked in all default hooks and delete cache. Try to see in browser dev tools is there any JavaScript errors and check theme product-list.tpl does id have some element with id product_list. Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 Thanks for the reply. I have put it live: http://mesfairepart.mon-projet-internet.com/ Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 module is hooked to category top using: {hook h="categoryTop"} yes i have emptied the cache no javascript errors product_list.tpl: the code is as follows: <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}"> Link to comment Share on other sites More sharing options...
razaro Posted September 21, 2015 Share Posted September 21, 2015 I do not see that block-layered.js and css files are loaded, so check if module is hooked into header hook. But more likely it is because of this part of code public function hookHeader($params) { if ((isset($this->context->controller->display_column_left) && !$this->context->controller->display_column_left) && (isset($this->context->controller->display_column_right) && !$this->context->controller->display_column_right)) return false; ..... so try to remove that whole if block, or if you are already using override, copy function without that code. Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 i am using overide and the content of the blocklayered.php is: <?php if (!defined('_CAN_LOAD_FILES_')) exit; class BlockLayeredOverride extends BlockLayered { public function install() { if(parent::install() && $this->registerHook('categoryTop')) return true; else return false; } public function hookCategoryTop($params) { /*die('I am here!');*/ return $this->hookLeftColumn($params); } } ?> Where are these code located? public function hookHeader($params) { if ((isset($this->context->controller->display_column_left) && !$this->context->controller->display_column_left) && (isset($this->context->controller->display_column_right) && !$this->context->controller->display_column_right)) return false; ..... Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 ok i located them in modules..blocklayered.php but yes, im using override...so how can i modify this please.. Link to comment Share on other sites More sharing options...
razaro Posted September 21, 2015 Share Posted September 21, 2015 Well it is in modules blocklayered.php file so grab that whole hookHeader function, just remove that if(..) return false Also check in blocklayered.js if you have $('#product_list') or $('.product_list') on few places, for you I think .product_list should work. Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 ok i did as youb asked and commented: /*if ((isset($this->context->controller->display_column_left) && !$this->context->controller->display_column_left) && (isset($this->context->controller->display_column_right) && !$this->context->controller->display_column_right)) return false;*/ yes it's $('.product_list') in the blocklayered.js Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 (edited) @razaro, seems like the filter is working, but keeps loading. I have tried the same change locally, and the filtering works, im thinking maybe it has something to do with friendly url. But the issue now is, when i do a filter, the appearance of the grid of products changes as shown on the screenshot (locally) Edited September 21, 2015 by fk_0786 (see edit history) Link to comment Share on other sites More sharing options...
razaro Posted September 21, 2015 Share Posted September 21, 2015 Think it is fetching product-list.tpl from default theme for some reason and not one from your theme. That is why code and styling are wrong. And I can see it is called just on one place but not sure why it is wrong, from github https://github.com/PrestaShop/blocklayered/blob/master/blocklayered.php#L3159 Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 the version im using is 2.0.7 you think i need to update my version to get this fixed, although i was adviced by @selectshop.at not to update and use the version 2.0.7 because of some bugs present in the new one Link to comment Share on other sites More sharing options...
fkaus Posted September 21, 2015 Author Share Posted September 21, 2015 in my blocklayered.php, here are the codes if ($nb_products == 0) $product_list = $this->display(__FILE__, 'blocklayered-no-products.tpl'); else $product_list = $smarty->fetch(_PS_THEME_DIR_.'product-list.tpl'); Link to comment Share on other sites More sharing options...
razaro Posted September 21, 2015 Share Posted September 21, 2015 You should not update like selectshop.at said and yeah that code looks the same. And it is long shot but you could try to check that value _PS_THEME_DIR_ or just with this code $product_list = $smarty->fetch(_PS_ROOT_DIR_.'/themes/mesfairepart/product-list.tpl'); Other then that dig deeper in modules code maybe there is somewhere else that tpl file is called. 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