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

Subcategory url is wrong when customer filter the results on category page #123

Closed
atul-emico opened this issue Dec 1, 2023 · 1 comment · Fixed by #136
Closed

Subcategory url is wrong when customer filter the results on category page #123

atul-emico opened this issue Dec 1, 2023 · 1 comment · Fixed by #136

Comments

@atul-emico
Copy link

Issue Brief

On category page we are showing subcategory slider on top (before products). The url of that subcategories are wrong.

Environment

  • PHP Version: (8.2)
  • Magento Version: 2.4.6-p3
  • Tweakwise Version: 5.3.3
  • Tweakwise Export Version:
  • Magento Deploy Mode: (development)
  • Third party modules:

Steps to reproduce

  1. Install Tweakwise module and do all required configuration and export data
  2. Create a category structure as like -
  • root category

    • tables
      • Dining tables
        • Oval
        • Round

    Product attributes -
    -Shape
    - Round
    - Oval

  1. Go to - base_url/tables-dinning-tables
  2. Filter by shape - round
  3. Now url will be - base_url/tables-dinning-tables/shape/round
  4. But subcategory url is wrong.

The issue is in code -
File - vendor/tweakwise/magento2-tweakwise/Model/Catalog/Layer/Url/Strategy/PathSlugStrategy.php
Line - 563

$url = implode('/', array_unique($explode));

array_unique is removing save values. There is comment that it is done to avoid double values. But in ur case we need to have that values.

Actual result

  1. Subcategory url - base_url/tables-dinning-tables/round/shape/

Expected result

Subcategory url should be - base_url/tables-dinning-tables/round/shape/round

@ah-net
Copy link
Collaborator

ah-net commented Dec 8, 2023

@atul-emico I'll see if we can replace the array unique with something else that only removes duplicate values if they are consecutive/ (like tables/round/round) i think this still solves the original problem and fixes your specific problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants