Front end router chooses wrong category due to not checking for locale

  • Posts: 27
  • Thank you received: 4
7 years 5 months ago #272235

-- HikaShop version -- : 3.0.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7
-- Browser(s) name and version -- : Chrome 58

Summary
The front end router does not constrain the URL query based on locale. It will search based on 'value' and pick the first result's reference_id. If there exists multiple category aliases across different languages with the same value, the MySQL query will choose the result with the lowest id. This causes the route to point to, say reference_id = 12, instead of the expected 13.

Steps to reproduce:

  1. Create 2 categories under main product category: Jackets and Vests
  2. Translate each of them. I have done them as the following:
    • Jackets => FR: Vestes, DA: Jakker
    • Vests => FR: Gilets, DA: Vestes
  3. Attach some products to each category
  4. In the front end, change locale to Danish. Click on 'Jakker'. The expected results show up
  5. Click on 'Vestes'. The URL will say 'products/vestes', but the category module will highlight 'Jakker' as being active
  6. Change the locale to French. Repeat the previous 2 steps (Vestes and Gilets, respectively). Each click will produce the correct expected results.

The queries in front/router.php function hikashop_retrieve_url_id() do not check for langauge_id.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 5 months ago #272244

Hi,

Thank you for your feedback. I've added a patch on our end in order to take into account the current language.
Download the install package on our website and install it on yours and that should work.

Please Log in or Create an account to join the conversation.

Time to create page: 0.126 seconds
Powered by Kunena Forum