Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BOOM-4870] Faceted search headings and buttons visible even if no products exist #9732

Closed
prestonBot opened this issue Aug 22, 2018 · 8 comments

Comments

@prestonBot
Copy link
Collaborator

@prestonBot prestonBot commented Aug 22, 2018

This issue has been migrated from the Forge. Read the original ticket here.

  • Reporter: webplus736
  • Created at: Tue, 20 Feb 2018 13:21:09 +0100

If there are products with no attributes for filtering, default theme will still display "Filter by" heading and "Clear all" button on PC and "Filter" button on mobile.

On mobile, there is condition used:

{if !empty($listing.rendered_facets)}

but it doesn't work, because this variable returns empty html div.

It would be great if these heading and buttons (whole module) is hidden, if there are no relevant results.

  • How to reproduce the issue ?

Go to category that has Facet search enabled, but there are no items to be displayed (products has no attributes). You can setup "Show products from subcategories" to NO to make it easier to test it in some subcategory with for example one product only.

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: khouloud.belguith
  • Created at: Tue, 20 Feb 2018 14:34:40 +0100

Hi Jiri,

Thanks for your report.
I manage to reproduce the issue with the last version 1730-rc1 and the ps_facetedsearch module v2.1.0
We will see how to fix it.

Best regards, Khouloud

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: webplus736
  • Created at: Tue, 20 Feb 2018 16:08:39 +0100

Hi Khouloud,
ok, thanks for feedback. I needed it in my custom theme too, where I'm expanding the facet search with extra button also in desktop mode. For now I solved it with JS:
/* hide filter button if no results */
if (!$('#search_filters_wrapper #search_filters').find('section.facet').length)

{ $('#top-list-bar .filter-button').hide(); }

But it's probably better / useful to have this in tpl so it can be used on other places...

Best regards,

Jiri

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: davenir
  • Created at: Thu, 19 Jul 2018 15:07:22 +0200

Still getting the same on 1.7.4

@prestonBot

This comment has been minimized.

Copy link
Collaborator Author

@prestonBot prestonBot commented Aug 22, 2018

This comment has been migrated from the Forge. Read the original comment here.

  • Author: khouloud.belguith
  • Created at: Thu, 19 Jul 2018 15:18:41 +0200

Hi David Q,

Sorry, this issue is not fixed yet.
There are some major issues to solve before this one.
So, it will probably not solved right now.
But PrestaShop is an open source project, so it can be solved before if someone submits a pull request to solve it.

Best regards, Khouloud

@prestonBot prestonBot referenced this issue Aug 23, 2018
31 of 40 tasks complete
@colinegin colinegin added this to Backlog in PrestaShop 1.7.6 via automation Feb 26, 2019
@colinegin colinegin moved this from Backlog to To do in PrestaShop 1.7.6 Feb 27, 2019
@colinegin colinegin moved this from To do to In progress in PrestaShop 1.7.6 Mar 1, 2019
@dividy

This comment has been minimized.

Copy link

@dividy dividy commented Mar 6, 2019

Temporary fix :

In your theme : catalog/_partials/facets.tpl

Wrap the content in a condition :

{if count($facets)>1}
.... file content ...
{/if}

@PierreRambaud

This comment has been minimized.

Copy link
Contributor

@PierreRambaud PierreRambaud commented Mar 6, 2019

Done in the next release of faceted search module :)

@PierreRambaud PierreRambaud moved this from In progress to To be reviewed in PrestaShop 1.7.6 Mar 19, 2019
@eternoendless

This comment has been minimized.

Copy link
Member

@eternoendless eternoendless commented Mar 25, 2019

Done here I think: PrestaShop/ps_facetedsearch#52

@mickaelandrieu mickaelandrieu moved this from To be reviewed to In progress in PrestaShop 1.7.6 Mar 27, 2019
@mickaelandrieu

This comment has been minimized.

Copy link
Member

@mickaelandrieu mickaelandrieu commented Mar 27, 2019

it's still a WIP => "In progress"

@colinegin colinegin moved this from In progress to To be reviewed in PrestaShop 1.7.6 Mar 29, 2019
@marionf marionf added Fixed and removed To Do labels Apr 12, 2019
@marionf marionf moved this from To be reviewed to To be merged in PrestaShop 1.7.6 Apr 15, 2019
@marionf marionf closed this Apr 15, 2019
PrestaShop 1.7.6 automation moved this from To be merged to Done Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
6 participants
You can’t perform that action at this time.