diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index d49860b7ac46e5f1f8d093310260d8406de9b0e0..ee03a52bec3a0052633d48aace52aeb834a107da 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -283,8 +283,21 @@ ProductUtils.getProductDetails = function(pid, priceListFilter, additionalProduc return priceLists[list]; } //customer deposited price list (defined by Attribute) - if (priceListFilter.priceList != "" && priceListFilter.priceList == priceLists[list].priceList) { - return priceLists[list]; + if (priceListFilter.priceList != "") { + var res; + var escape; + // runs trough the possible pricelists to find the one with the correct pricelist ("-type"). + // e.g: PRICELISTSERVICE, PRICELISTSPECIAL, PRICELISTKEY, PRICELISTDEFAULT + for(var index in priceLists) + { + + if (priceLists[index]["priceList"] == priceListFilter.priceList) + { + res = priceLists[index]; //The first time the condition is true the correct pricelist is found. + break; // The object is ordered by fromQuantity descending so we have to stop after the condition is true + } + } + return res; } //default price list if (priceLists[list].priceList == $KeywordRegistry.productPricelist$standardList()) {