diff --git a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js index c1d2fd3f91051..d78d62876f230 100644 --- a/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js +++ b/app/code/Magento/Swatches/view/frontend/web/js/swatch-renderer.js @@ -259,6 +259,9 @@ define([ // whether swatches are rendered in product list or on product page inProductList: false, + // sly-old-price block selector + slyOldPriceSelector: '.sly-old-price', + // tier prise selectors start tierPriceTemplateSelector: '#tier-prices-template', tierPriceBlockSelector: '[data-role="tier-price-block"]', @@ -837,6 +840,12 @@ define([ } ); + if (result.oldPrice.amount != result.finalPrice.amount) { + $(this.options.slyOldPriceSelector).show(); + } else { + $(this.options.slyOldPriceSelector).hide(); + } + if (result.tierPrices.length) { if (this.options.tierPriceTemplate) { tierPriceHtml = mageTemplate(