-- 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:
- Create 2 categories under main product category: Jackets and Vests
- Translate each of them. I have done them as the following:
- Jackets => FR: Vestes, DA: Jakker
- Vests => FR: Gilets, DA: Vestes
- Attach some products to each category
- In the front end, change locale to Danish. Click on 'Jakker'. The expected results show up
- Click on 'Vestes'. The URL will say 'products/vestes', but the category module will highlight 'Jakker' as being active
- 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.