0

I have overridden the method

wrapResult

inside:

\Magento\Catalog\Pricing\Render\FinalPriceBox.php

Firstly the correct price is displayed but after a few seconds it changes the price.

I've been following it and this change comes from the following js:

'Magento_Catalog/js/price-box.js'

Method:

 reloadPrice: function reDrawPrices() {
        var priceFormat = (this.options.priceConfig && this.options.priceConfig.priceFormat) || {},
            priceTemplate = mageTemplate(this.options.priceTemplate);

        _.each(this.cache.displayPrices, function (price, priceCode) {
            price.final = _.reduce(price.adjustments, function (memo, amount) {
                return memo + amount;
            }, price.amount);

            price.formatted = utils.formatPrice(price.final, priceFormat);

            $('[data-price-type="' + priceCode + '"]', this.element).html(priceTemplate({
                data: price
            }));
        }, this);
    },

The value of this.cache.displayPrices in this foreach is the following:

enter image description here

How can I ensure this method has the updated values to prevent it set me wrong values or how can I disable it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.