Product combination URLs use the private attribute group name instead of the public name
Prerequisites
- [x] I understand and accept the project's code of conduct.
- [x] I have already searched in existing issues and found no previous report of this bug.
Describe the bug and add attachments
Product combination URLs use the internal attribute group name instead of the public name.
For example, if an attribute group's internal name is "Shirt color" and its public name is "Color", the URL fragment contains "shirt-color" instead of "color".
This was previously fixed in PrestaShop 8 in #36664, which addressed #35976. The fix appears to have been lost when the 8.2.x branch was merged into the development branch.
In PrestaShop 9, Product::getAttributesParams() already returns the public group name as public_group, but Product::getAnchor() still builds the URL fragment using group.
Steps to reproduce
- Create an attribute group with different internal and public names:
- Name: "Shirt color"
- Public name: "Color"
- Add at least two attribute values, for example "Red" and "Blue".
- Create a product with combinations using these attribute values.
- Open the product page and select a combination.
- Check the URL fragment in the browser's address bar.
Expected behavior
The URL fragment should use the public attribute group name, for example:
#/color-red
Actual Result
The URL fragment uses the internal attribute group name, for example:
#/shirt_color-red
PrestaShop version where the bug happens
9.2.1
How have you installed PrestaShop
No response
PHP version(s) where the bug happened
8.5
Your company or customer's name goes here (if applicable).
No response