21/10/2023 Franck Bugnet How to

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



  1. 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.
  2. 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.
  3. Select one or more groups in the left-hand table, which displays the list of attributes for these groups in the center.
  4. Selecting the attributes to be merged can be done either manually with a left click (beginning of a list).
  5. A shift+left-click to indicate the end of the list.
  6. 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.



Note: if you wish to keep one of the attributes in particular, you must select it first.



Attribute selection with shift or ctrl

Even more efficient, you can use the "Find and select" tool, which works in all tables, as for example here with features:

  1. Right-click in the column on which to filter, if possible in the row of the value to be searched.
  2. From the menu, choose "Search and select" from the pop-up menu.
  3. Parameterize your search filter with your criteria, with contains, equals, begins with etc.
  4. Validate.


Automatic search and selection

Great, even values that are differentiated by capital letters are found and selected automatically:

Search result and automatic selection

Merlin Backoffice avoids the purchase of a PrestaShop Duplicate Merge Module

    1. Click on the button to group lines.
    2. Type or modify the name given to the retained attribute (the first selected) in the cell.
    3. 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.
    4. Validate.



Launch duplicate attribute merge

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.



Duplicate attributes have been removed

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. :

  1. Select the attribute groups to be deleted.
  2. Check that the attrbituts table is empty .
  3. Then click on the delete button on the left and validate.


Delete attribute groups

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

Settings
  • Login
    • £ GBP
    • $ USD
Menu