Custom calculation works, but SignalR is effective now
This commit is contained in:
parent
7d82c86261
commit
34455c0de5
|
|
@ -73,5 +73,5 @@ public class PluginNopStartup : INopStartup
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets order of this startup configuration implementation
|
/// Gets order of this startup configuration implementation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int Order => 4000;
|
public int Order => 100;
|
||||||
}
|
}
|
||||||
|
|
@ -62,19 +62,22 @@ public class CustomPriceCalculationService : PriceCalculationService
|
||||||
int quantity = 1, DateTime? rentalStartDate = null, DateTime? rentalEndDate = null)
|
int quantity = 1, DateTime? rentalStartDate = null, DateTime? rentalEndDate = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
var productAttributeMappings = await _productAttributeService.GetAllProductAttributesAsync(product.Id);
|
var productAttributeMappings = await _specificationAttributeService.GetProductSpecificationAttributesAsync(product.Id);
|
||||||
//Product Attributes
|
//Product Attributes
|
||||||
foreach (var pam in productAttributeMappings)
|
foreach (var pam in productAttributeMappings)
|
||||||
{
|
{
|
||||||
var attributes = await _productAttributeService.GetProductAttributeValuesAsync(pam.Id);
|
//get option
|
||||||
foreach (var attr in attributes)
|
var attributeOtion = await _specificationAttributeService.GetSpecificationAttributeOptionByIdAsync(pam.SpecificationAttributeOptionId);
|
||||||
{
|
|
||||||
// you can check for specific attribute by its name or id
|
//get attribute
|
||||||
if (attr.Name == "NeedsToBeMeasured" && attr.IsPreSelected)
|
var attribute = await _specificationAttributeService.GetSpecificationAttributeByIdAsync(attributeOtion.SpecificationAttributeId);
|
||||||
|
|
||||||
|
// you can check for specific attribute by its name or id
|
||||||
|
if (attribute.Name == "Needs to be measured for price")
|
||||||
{
|
{
|
||||||
return (0m, 0m, 0m, new List<Discount>());
|
return (0m, 0m, 0m, new List<Discount>());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return await base.GetFinalPriceAsync(product, customer, store, overriddenProductPrice, additionalCharge, includeDiscounts, quantity, rentalStartDate, rentalEndDate);
|
return await base.GetFinalPriceAsync(product, customer, store, overriddenProductPrice, additionalCharge, includeDiscounts, quantity, rentalStartDate, rentalEndDate);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue