@@ -1728,7 +1728,6 @@ public ActionResult CrossSellProductAddPopup(int productId)
17281728 }
17291729
17301730 //manufacturers
1731- // model.AvailableManufacturers.Add(new SelectListItem() { Text = _localizationService.GetResource("Admin.Common.All"), Value = "0" }); // codehint: sm-delete
17321731 foreach ( var m in _manufacturerService . GetAllManufacturers ( true ) )
17331732 {
17341733 model . AvailableManufacturers . Add ( new SelectListItem ( ) { Text = m . Name , Value = m . Id . ToString ( ) } ) ;
@@ -3187,7 +3186,6 @@ public ActionResult TierPriceInsert(GridCommand command, ProductModel.TierPriceM
31873186 ProductId = model . ProductId ,
31883187 // use Store property (not Store propertyId) because appropriate property is stored in it
31893188 StoreId = model . Store . ToInt ( ) ,
3190- // codehint: sm-edit
31913189 // use CustomerRole property (not CustomerRoleId) because appropriate property is stored in it
31923190 CustomerRoleId = model . CustomerRole . IsNumeric ( ) && Int32 . Parse ( model . CustomerRole ) != 0 ? Int32 . Parse ( model . CustomerRole ) : ( int ? ) null ,
31933191 Quantity = model . Quantity ,
@@ -3214,7 +3212,6 @@ public ActionResult TierPriceUpdate(GridCommand command, ProductModel.TierPriceM
32143212 //use Store property (not Store propertyId) because appropriate property is stored in it
32153213 tierPrice . StoreId = model . Store . ToInt ( ) ;
32163214 //use CustomerRole property (not CustomerRoleId) because appropriate property is stored in it
3217- // codehint: sm-edit
32183215 tierPrice . CustomerRoleId = model . CustomerRole . IsNumeric ( ) && Int32 . Parse ( model . CustomerRole ) != 0 ? Int32 . Parse ( model . CustomerRole ) : ( int ? ) null ;
32193216 tierPrice . Quantity = model . Quantity ;
32203217 tierPrice . Price = model . Price1 ;
@@ -3855,7 +3852,6 @@ public ActionResult ProductVariantAttributeCombinationList(GridCommand command,
38553852 if ( ! _permissionService . Authorize ( StandardPermissionProvider . ManageCatalog ) )
38563853 return AccessDeniedView ( ) ;
38573854
3858- // codehint: sm-edit
38593855 // TODO: Replace ProductModel.ProductVariantAttributeCombinationModel by AddProductVariantAttributeCombinationModel
38603856 // when there's no grid-inline-editing anymore.
38613857
@@ -3877,6 +3873,21 @@ public ActionResult ProductVariantAttributeCombinationList(GridCommand command,
38773873 pvacModel . ProductUrl = productUrl + _productAttributeParser . SerializeQueryData ( product . Id , x . AttributesXml ) ;
38783874 pvacModel . ProductUrlTitle = productUrlTitle ;
38793875
3876+ try
3877+ {
3878+ var firstAttribute = _productAttributeParser . DeserializeProductVariantAttributes ( x . AttributesXml ) . FirstOrDefault ( ) ;
3879+
3880+ var attribute = x . Product . ProductVariantAttributes . FirstOrDefault ( y => y . Id == firstAttribute . Key ) ;
3881+
3882+ var attributeValue = attribute . ProductVariantAttributeValues . FirstOrDefault ( y => y . Id == int . Parse ( firstAttribute . Value . First ( ) ) ) ;
3883+
3884+ pvacModel . DisplayOrder = firstAttribute . Key + attributeValue . DisplayOrder ;
3885+ }
3886+ catch ( Exception exc )
3887+ {
3888+ exc . Dump ( ) ;
3889+ }
3890+
38803891 //if (x.IsDefaultCombination)
38813892 // pvacModel.AttributesXml = "<b>{0}</b>".FormatWith(pvacModel.AttributesXml);
38823893
@@ -3885,7 +3896,8 @@ public ActionResult ProductVariantAttributeCombinationList(GridCommand command,
38853896 pvacModel . Warnings . AddRange ( warnings ) ;
38863897
38873898 return pvacModel ;
3888- } ) . ToList ( ) ;
3899+ } )
3900+ . OrderBy ( x => x . DisplayOrder ) . ToList ( ) ;
38893901
38903902 var model = new GridModel < ProductVariantAttributeCombinationModel >
38913903 {
0 commit comments