PrestaShop icon indicating copy to clipboard operation
PrestaShop copied to clipboard

Product combination URLs use the private attribute group name instead of the public name

Open wwatu1337 opened this issue 3 days ago • 0 comments

Prerequisites

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

  1. Create an attribute group with different internal and public names:
    • Name: "Shirt color"
    • Public name: "Color"
  2. Add at least two attribute values, for example "Red" and "Blue".
  3. Create a product with combinations using these attribute values.
  4. Open the product page and select a combination.
  5. 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

wwatu1337 avatar Dec 02 '26 14:12 wwatu1337