Jump to content

blocklayered module not working properly


fkaus

Recommended Posts

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.

post-1093790-0-67394200-1442576659_thumb.png

Edited by fk_0786 (see edit history)
Link to comment
Share on other sites

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&section=attach&attach_id=134284

 

Version of the module is 2.0.7.

 

Link to comment
Share on other sites

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 by fk_0786 (see edit history)
Link to comment
Share on other sites

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 by selectshop.at (see edit history)
Link to comment
Share on other sites

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

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

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

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

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

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

@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)

 

 

post-1093790-0-24309600-1442837500_thumb.jpg

Edited by fk_0786 (see edit history)
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...