Skip to content

Commit

Permalink
- fixed bug when top variant price was not selected (#948)
Browse files Browse the repository at this point in the history
variant children range price but all product range price;
  • Loading branch information
newsiberian authored and zenweasel committed Apr 12, 2016
1 parent 5b032d0 commit c4a4c46
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ Template.productDetail.helpers({
const current = ReactionProduct.selectedVariant();
if (typeof current === "object") {
const childVariants = ReactionProduct.getVariants(current._id);
// when top variant has no child variants we display only its price
if (childVariants.length === 0) {
return current.price;
}
return ReactionProduct.getProductPriceRange().range;
// otherwise we want to show child variants price range
return ReactionProduct.getVariantPriceRange();
}
},
fieldComponent: function () {
Expand Down

0 comments on commit c4a4c46

Please sign in to comment.