Skip to content

[Issue] Search Navigation not visible if default category has "Display Mode" other than "page" #39561

Open
@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #39555: Search Navigation not visible if default category has "Display Mode" other than "page"


Resolve search result navigation block visibility even if website default category has "Display Mode" with value other than "page"

Description (*)

In catalogsearch result page, the current category is the Default Category, see \Magento\Catalog\Model\Layer::getCurrentCategory()
In case the default category has Display mode value "Static block only" or "Static block and products", canShowBlock method condition is false and the navigation block is not visible.
Added a or condition to check also the routeName in canShowBlock method to avoid current behavior.

Related Pull Requests

Fixed Issues (if relevant)

  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Create a product attribute of type dropdown, add two options and configure storefront properties with
    • Use in Search: Yes
    • Use in Layered Navigation : Filterable with result
    • Use in Search Results Layered Navigation: Yes
  2. Add the attribute to Default attribute set
  3. Create 2 simple products (Default attribute set), and for each product set different value for the new attribute previously added.
  4. In Catalog > Category > Default Category set the Display mode "Static block only" or "Static block and products" and save
  5. Reindex and clear cache
  6. Layered navigation block is visible in search result page, previously was not.

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: CatalogComponent: SearchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.xIndicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Pull Request In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions