Merge multiple PrestaShop attribute duplicates
Sometimes, following the successive creation or import of files from various suppliers, you end up with a lot of duplicate attribute values, which only weigh down the tables and slow down the PrestaShop database and store. Cleaning up this type of data manually is almost impossible, as it would be very time-consuming. It's essential to have a tool that enables you to clean up by merging identical or similar attributes, even when they belong to different groups, without breaking the existing variations that use them.
For example, if you have two families that have been created, named "Color" and "color", containing "red" and "Red" in the first and "Tomato Red" in the second, it would be interesting to be able to merge all this into a single "Color" group containing just the color "Red", with just a few clicks.
Impossible to achieve with PrestaShop, but the PrestaShop Merlin Backoffice software, version 1.6 onwards, makes it possible.
Tables and data lists will be shorter, and searching in attribute management fields simpler to use. So, without a single line of PHP or html code or css fiddling, this feature will make the store faster, and you'll make life easier for your customers, so in fine improve conversion.
Display and select attributes to merge
- Connect the Merlin module to your database, no need to select categories or even display products or declinations, go directly to the "Declinations and images" tab, then the "Attributes" sub-tab.
- Click on the "View" button at the bottom of the tab for Merlin to display the list of attribute groups present in the tables as a base.
- Select one or more groups in the left-hand table, which displays the list of attributes for these groups in the center.
- Selecting the attributes to be merged can be done either manually with a left click (beginning of a list).
- A shift+left-click to indicate the end of the list.
- A crtl+left-click to add a delete the selection of one line at a time. In this example, an attribute from another attribute group is added to the list.

Even more efficient, you can use the "Find and select" tool, which works in all tables, as for example here with features:
- Right-click in the column on which to filter, if possible in the row of the value to be searched.
- From the menu, choose "Search and select" from the pop-up menu.
- Parameterize your search filter with your criteria, with contains, equals, begins with etc.
- Validate.

Great, even values that are differentiated by capital letters are found and selected automatically:
Merlin Backoffice avoids the purchase of a PrestaShop Duplicate Merge Module
- Click on the button to group lines.
- Type or modify the name given to the retained attribute (the first selected) in the cell.
- You can check this box to tell Merlin to stop offering to modify the attribute name. It will then always take the value of the first line selected.
- Validate.

What exactly does this PrestaShop module for replacing and then deleting duplicate attributes do?
- Only one attribute is retained (a single value identifier), the first in the selection.
- Its name is replaced by the new value entered.
- The identifiers of the other values, if they belonged to declinations, are replaced in these declinations by the identifier of the one retained.
- These other attributes are then permanently deleted from the database.

Can attributes belonging to different families be merged?
Yes, the method is exactly the same, it's just a matter of the initial selection including these attributes, so having first selected the different attribute groups with crtl + click for example. This is what we've done in step 6 of the example shown above.
The declinations that contained attributes deleted in group B are of course retained, but the attributes in these declinations are replaced by their duplicates retained in group A, for example.
Take care, therefore, to only merge values of the same type. For example, if you have two attribute groups, "Chrome finish" and "Metallic paint", both containing the attributes "Yes" and "No", merging them would undoubtedly be a mistake.
Moving attributes into another group without breaking the variations of products using them?
This module also features a function for copying attribute values from one (or more) group(s) to another (or others).
To move attributes, without breaking the base structure and declinations, you therefore need to duplicate them in the group to be retained with the copy function, then merge them with the values to be retained to remove duplicates, and finally delete the empty group(s).
The step-by-step method is the same as that described in the article on moving feature values. Thank you for watching this other tutorial.
Delete empty categories from shop
After grouping attributes from different groups, some groups may be empty and of no use. You might as well delete them to lighten the base a little more. :
- Select the attribute groups to be deleted.
- Check that the attrbituts table is empty .
- Then click on the delete button on the left and validate.

ATTENTION:
- If you delete an attribute, without having merged it, declinations containing this property will lose it and it will then be impossible to find them again to add another one in its place.
- If you delete an attribute group containing attributes used in declinations, these attributes will also be deleted, along with their presence in all declinations of all products, with no way of going back. So remember to merge or move them first.
Category's other articles Managing PrestaShop variations and attributes
-
How to set the order of display variations in your product pages?
How to
With PrestaPricing (or now Merlin Backoffice) , the Swiss knife addon for PrestaShop, you can also easily change the display order of variations of attributes in product pages. This tutorial is showing this in images, here's how
-
How to export product variations?
How to
This tutorial explains the best way to export the product variations from PrestaShop, using PrestaPricing or Merlin Backoffice addons from Sitolog
-
How to show and modify the color squares (color selectors)
How to
See in images how you to choose or modify the colors of the small square selectors associated with each color attribute of PrestaShop product, using Merlin Backoffice addon
-
How to quickly create declination attributes in PrestaShop
How to
Step-by-step tutorial for adding attribute groups and attribute values to create product variations. Two methods are explained, with PrestaShop and by batch with the Merlin Backoffice module
-
How to deactivate a declination in PrestaShop without deleting it
Trick
How to
Here's a quick and easy way to deactivate one or more declinations in PrestaShop, in one or more products at a time, without having to delete them or reset their stock, thanks to Merlin Backoffice