Specification Attributes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
What would make using specification attributes easier would be a second "display order" field. One for displaying the attributes within admin functions, and a second for filter by specification attributes on the public store side.
7 years ago
Thanks for suggestion. But I think it'll just make it more complex to manage them.
7 years ago
GreatAdventure.ca wrote:
What would make using specification attributes easier would be a second "display order" field. One for displaying the attributes within admin functions, and a second for filter by specification attributes on the public store side.

We found the admin vs. public sort order to be a slight problem too as we have over 2000 different attributes to manage. The main issue was with trying to add new attributes to products when you have to select the attibute from the dropdown box. It's much easier to find the attribute in the dropdown if they're listed in alphabetical order. I made a small modification to the _CreateOrUpdate.SpecificationAttributes.cshtml view in the Admin site to sort it alphbetically (addition in bold):

@Html.DropDownListFor(model => model.AddSpecificationAttributeModel.SpecificationAttributeId, Model.AddSpecificationAttributeModel.AvailableAttributes.OrderBy(sa => sa.Text))
7 years ago
petemitch wrote:

We found the admin vs. public sort order to be a slight problem too as we have over 2000 different attributes to manage. The main issue was with trying to add new attributes to products when you have to select the attibute from the dropdown box. It's much easier to find the attribute in the dropdown if they're listed in alphabetical order. I made a small modification to the _CreateOrUpdate.SpecificationAttributes.cshtml view in the Admin site to sort it alphbetically (addition in bold):

@Html.DropDownListFor(model => model.AddSpecificationAttributeModel.SpecificationAttributeId, Model.AddSpecificationAttributeModel.AvailableAttributes.OrderBy(sa => sa.Text))


Thanks Pete, that worked great for the drop down in the product page. Is there an easy way to be able to sort in the "Admin/SpecificationAttribute/List"?

2,000 different attributes to manage --- Wow! We are struggling with only 200+

All the best!
Shawn
7 years ago
GreatAdventure.ca wrote:
Thanks Pete, that worked great for the drop down in the product page. Is there an easy way to be able to sort in the "Admin/SpecificationAttribute/List"?

It's not possible to hack it in the view like it is with the product page but if you're using the source code version of nop and you're happy to make a small modification to the source it's easy. Just find the GetSpecificationAttributes in the SpecificationAttributeService.cs file and change the sort order like so:

/// <summary>
/// Gets specification attributes
/// </summary>
/// <param name="pageIndex">Page index</param>
/// <param name="pageSize">Page size</param>
/// <returns>Specification attributes</returns>
public virtual IPagedList<SpecificationAttribute> GetSpecificationAttributes(int pageIndex = 0, int pageSize = int.MaxValue)
{
    var query = from sa in _specificationAttributeRepository.Table
    orderby sa.Name, sa.Id
    select sa;
    var specificationAttributes = new PagedList<SpecificationAttribute>(query, pageIndex, pageSize);
    return specificationAttributes;
}
7 years ago
Hello. Do you plan to export specification attributes to Excel?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.