From 3a12905324c8e4975e554eeeec41552627e4369c Mon Sep 17 00:00:00 2001 From: Danny Verkade Date: Thu, 3 May 2018 20:26:06 +0200 Subject: [PATCH] Fix for displaying a negative price for a custom option. Currently a negative price is displayed as +- 5.00 for instance. By changing the template to check of the value is actually positive a negative value will be displayed as - 5.00 and a positive value will be displayed as + 5.00 --- app/code/Magento/Catalog/view/base/web/js/price-options.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/view/base/web/js/price-options.js b/app/code/Magento/Catalog/view/base/web/js/price-options.js index ceeea4c878622..e18abe3af38a6 100644 --- a/app/code/Magento/Catalog/view/base/web/js/price-options.js +++ b/app/code/Magento/Catalog/view/base/web/js/price-options.js @@ -20,8 +20,10 @@ define([ optionConfig: {}, optionHandlers: {}, optionTemplate: '<%= data.label %>' + - '<% if (data.finalPrice.value) { %>' + + '<% if (data.finalPrice.value > 0) { %>' + ' +<%- data.finalPrice.formatted %>' + + '<% } else if (data.finalPrice.value < 0) { %>' + + ' <%- data.finalPrice.formatted %>' + '<% } %>', controlContainer: 'dd' };