Add categories depending on attributes
Assigning products to Magento categories already works very quickly in cobby. But sometimes it happens that you want to assign a new category depending on e.g. an attribute or an attribute combination. As long as all products are assigned to the same categories, this can be solved using the filter function in Excel. But if the products are not assigned to the same categories, you have to try something different.
In our example, we want to assign all items that are reduced to the Sale category.
-
To do this, we first create two new help columns next to the category column. The first column should contain the currently assigned categories and the second the category Sale, if a special price is entered. Both columns will then be merged via the CONCATENATE function in the category column.
-
To save the currently assigned categories, we select the category column and copy all entries to the first new column.
-
Now we select the first cell of the second column and switch to the formula bar. Since we only want to assign the Sale category if the Special-Price is filled, we use the IF function. The check is True if the Special-Price > 0 and then sets the value for the new category. The easiest way to find out exactly what this is called is to assign the new category to a product and then copy the value from the formula bar. In our example the formula looks like this =IF([@[Special Price]]>0;"|Root/Sale";"").
-
We now apply this formula to all rows in the column.
-
In the last step we concatenate the two new columns in the category column. To do this, we select the first cell in the category column and switch to the formula bar. There we enter the function CONCATENATE and pass the already assigned categories from the first and the sale category from the second new column (don't forget: change the cell format to "Standard").
-
Finally, apply the formula to the other cells in the column and save the products.