Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,10 @@ async Task<ProductPrice> PrepareModel()
}
}
}
//summarize price of all attributes
double attributesTotalPrice = 0;
if (!finalPrice.HasValue)
{
//summarize price of all attributes
double attributesTotalPrice = 0;
{
if (attributes != null && attributes.Any())
{
var attributeValues = product.ParseProductAttributeValues(attributes);
Expand All @@ -587,34 +587,36 @@ async Task<ProductPrice> PrepareModel()
}
}
}
if (!product.EnteredPrice)
}

if (!product.EnteredPrice)
{
var qty = 0;
if (_shoppingCartSettings.GroupTierPrices)
{
var qty = 0;
if (_shoppingCartSettings.GroupTierPrices)
{
qty = customer.ShoppingCartItems
.Where(x => x.ProductId == product.Id)
.Where(x => x.ShoppingCartTypeId == shoppingCartType)
.Sum(x => x.Quantity);
}
if (qty == 0)
qty = quantity;

var getfinalPrice = await GetFinalPrice(product,
customer,
currency,
attributesTotalPrice,
includeDiscounts,
qty,
rentalStartDate,
rentalEndDate);

finalPrice = getfinalPrice.finalPrice;
discountAmount = getfinalPrice.discountAmount;
appliedDiscounts = getfinalPrice.appliedDiscounts;
qty = customer.ShoppingCartItems
.Where(x => x.ProductId == product.Id)
.Where(x => x.ShoppingCartTypeId == shoppingCartType)
.Sum(x => x.Quantity);
}
if (qty == 0)
qty = quantity;

var getfinalPrice = await GetFinalPrice(product,
customer,
currency,
finalPrice ??= 0 + attributesTotalPrice,
includeDiscounts,
qty,
rentalStartDate,
rentalEndDate);

finalPrice = getfinalPrice.finalPrice;
discountAmount = getfinalPrice.discountAmount;
appliedDiscounts = getfinalPrice.appliedDiscounts;
}


finalPrice ??= 0;

//rounding
Expand Down