Question: I am new in Magento and need to learn. I have a platform based on Magento 1.9 developed by another developer. i have addeded custom option of color. but there is size custom option already added before. in the frontend, the tile appear at the bottom of the new color custom option is the size custom option and the validation also inherit the size custom optio. Where can fix this ?

[![enter image description here](https://i.stack.imgur.com/Yff6R.png)](https://i.stack.imgur.com/Yff6R.png)

Answer: 
With ternary conditional operator

```
books.GroupBy(b => b.Price < 10 ? 10 : (b.Price < 20 ? 20 : 30));

```
First - add category to the list

```
var newBookList = BookList.Select(x=> new { Book = x, 
                                     Category = x.Price <= 10 ? 10 : 
                                                x.Price <= 20 ? 20 : 
                                                30 } ).ToList();

```

then Group By this Category :

```
var GroupedBooks = newBookList.GroupBy(x=>x.Category);
foreach(var category in GroupedBooks.Keys) {
         Console.WriteLine("category : {0}", category);
         foreach(var b in GroupedBooks[Keys].Select(x=>x.Book))
          Console.Write("Book {0}, \"{1}\", {2}",b.Id, b.Name, b.Price);
}

```

something like that?