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

Commit

Permalink
VP-1565: Fix product details view (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
AliveMen authored Mar 4, 2020
1 parent e00229c commit b56339a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions assets/js/product.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,16 @@ storefrontApp.controller('productController', ['$rootScope', '$scope', '$window'
});
});

//Auto select initial product as default variation (its possible because all our products is variations)

var propertyMap = getVariationPropertyMap(product);
var key = _.first(_.keys(propertyMap));
$scope.checkProperty(propertyMap[key][0]);

//$scope.selectedVariation = product;
if (key){
$scope.checkProperty(propertyMap[key][0]);
}
else {
//Auto select initial product as default variation (its possible because all our products is variations)
$scope.selectedVariation = product;
}
});
}

Expand Down

0 comments on commit b56339a

Please sign in to comment.