Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

Commit

Permalink
fix sonar issues
Browse files Browse the repository at this point in the history
Change properties view order
  • Loading branch information
AliveMen committed Mar 24, 2020
1 parent d37f063 commit a3d3699
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions assets/js/products-compare/product-compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ storefrontApp.controller('productCompareListController', ['$rootScope', '$scope'
catalogService.getProducts(productsIds).then(function(response) {
if (_.indexOf(productsIds, '&') != -1) {
$scope.products = response.data;
_.each($scope.products, function(product) {
modifyProperty(product);
_.each($scope.products, function(prod) {
modifyProperty(prod);
})
}
else {
Expand All @@ -27,15 +27,15 @@ storefrontApp.controller('productCompareListController', ['$rootScope', '$scope'
$scope.getProductProperties();
$scope.loaded = true;
})
};
}

$scope.getProductProperties = function () {
if (_.isEmpty($scope.products))
return [];
var grouped = {};

var properties = _.flatten(_.map($scope.products, function(product) { return product.variationProperties; }));
properties = properties.concat(_.flatten(_.map($scope.products, function(product) { return product.properties; })));
var properties = _.flatten(_.map($scope.products, function(product) { return product.properties }));
properties = properties.concat(_.flatten(_.map($scope.products, function(product) { return product.variationProperties; })));

var propertyDisplayNames = _.uniq(_.map(properties, function(property) { return property.displayName; }));
_.each(propertyDisplayNames, function(displayName) {
Expand Down Expand Up @@ -94,7 +94,7 @@ storefrontApp.controller('productCompareListController', ['$rootScope', '$scope'
function formatNumber(number) {
var float = parseFloat(number);
return !isNaN(float) ? float : number;
};
}
initialize();
}
])
Expand Down

0 comments on commit a3d3699

Please sign in to comment.