Skip to main content

Magento2- Remove plus sign from the configurable product attributes that have additional price

To do this we need to work on the design area it is the easiest way 

firs Create new folder under your theme 

Folder Name: Magento_ConfigurableProduct\web\js

Copy this file "configurable.js" from this path

vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js 

in the line 407 you need to modify this part

 

// vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js
// ... Line 407 on Magento 2.2.x, 2.3.x
allowedProducts = options[i].products.slice(0);

if (typeof allowedProducts[0] !== 'undefined' &&
    typeof optionPrices[allowedProducts[0]] !== 'undefined') {
    allowedProductMinPrice = this._getAllowedProductWithMinPrice(allowedProducts);
    optionFinalPrice = parseFloat(optionPrices[allowedProductMinPrice].finalPrice.amount);
    optionPriceDiff = optionFinalPrice - basePrice;

    if (optionPriceDiff !== 0) {
        options[i].label = options[i].label + ' ' + priceUtils.formatPrice(
            optionPriceDiff,
            this.options.priceFormat,
            true);
    }
}
// ...

 

 

/ ... Line 407 on Magento 2.2.x, 2.3.x
allowedProducts = options[i].products.slice(0);

if (typeof allowedProducts[0] !== 'undefined' &&
    typeof optionPrices[allowedProducts[0]] !== 'undefined') {
    allowedProductMinPrice = this._getAllowedProductWithMinPrice(allowedProducts);
    optionFinalPrice = parseFloat(optionPrices[allowedProductMinPrice].finalPrice.amount);
    optionPriceDiff = optionFinalPrice - basePrice;

    // Removed code to prevent price diff from appearing on the frontend
    /*if (optionPriceDiff !== 0) {
        options[i].label = options[i].label + ' ' + priceUtils.formatPrice(
            optionPriceDiff,
            this.options.priceFormat,
            true);
    }*/