remove block in category page when a product filter is used

Hello,



On every categorypage I display a banner (300px height) on top of the page.

Now I would like to see it completely removed whenever a product filter is used, so the products become visable immediately on top of the page.



Anyone knows if this is possible?



Thanks,



Mark

Hi @mwouters,

Please let me know you cs-cart version and i will create an simple addon for you







Valentin

Great Valentin!

It's Ultimate 3.0.6



Thanks a million!

[list=1]

[]download file from here

[
]extract and copy file [color=#ff0000]hide_banners_on_category.tpl[/color] to skins/[SKIN_NAME]/customer/addons/my_changes/blocks/wrappers/ ( you need addon my_changes to be enabled )

[*]after creating the banner block on Design > Blocks > Categories choose Wrapper [color=#ff0000]_hide_banners_on_category.tpl[/color]

[/list]





I hope that helps,





Valentin

Hello Valentin,



Did what you told me to do above, but it doesn't seem to work…

I have my changes enabled, I already used it for other changes.

I was able to select the wrapper.



Thanks,



Mark

Correction, it does work when selecting certain filters, but not when I use the price filter/limitor…

Thank you @mwouters

i identify the bug and i will come with a fix soon

Sorry for the delay,

Fix for hide banner also on price slider action:



#modify file js/core.js



search for [color=#ff0000]elm.slider({[/color] and add


//add by HungryWeb.net for addon hide_banners_on_category
$('.hide_categories').hide();
//end


at the end of change action



ex:

[color=#ff0000]before:[/color]


change: function(event, ui){
var replacement = data.type + ui.values[0] + '-' + ui.values[1];
if (data.type == 'P') {
replacement = replacement + '-' + data.currency;
}
var url = data.url.replace(data.type + '###-###', replacement);
if (!data.ajax) {
$.toggleStatusBox('show');
$.redirect(url);
} else {
$.ajaxRequest(url, {
full_render: true,
result_ids: data.result_ids,
caching: true
});
}
}




[color=#008000]after adding code:[/color]
change: function(event, ui){
var replacement = data.type + ui.values[0] + '-' + ui.values[1];
if (data.type == 'P') {
replacement = replacement + '-' + data.currency;
}
var url = data.url.replace(data.type + '###-###', replacement);
if (!data.ajax) {
$.toggleStatusBox('show');
$.redirect(url);
} else {
$.ajaxRequest(url, {
full_render: true,
result_ids: data.result_ids,
caching: true
});
}

//add by HungryWeb.net for addon hide_banners_on_category
$('.hide_categories').hide();
//end

}






PS:modification has been added on v3.0.6



Please try it out, it should help.





Valentin

Hello Valentin,



Thanks for this, but I guess you are now changing the js for the build in slider?

Because I’m using a plugin for the slider called Seonid: Headlines. So before I try this I want to make sure :-)



Thanks,



Mark

Dear @Mark,

Please add the code and i will check the link provided in PM

Doesn't matter because slider is inside the wrapper and he will be hidden after any filter selected or price slider changes





Valentin

Sorry Valentin, I now see what you are doing. Stupid of me.

And it works great!!

Thanks a million!



Mark