scandipwa / scandipwa

Next-generation front-end for Magento 2

Home Page:https://scandipwa.com/?utm_source=github&utm_medium=readme&utm_campaign=general

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Price processing for wishlist

Gziri opened this issue · comments

Steps to reproduce/Actual result:
The product price in the wishlist is not rendered properly:
In Store/Wishlist/Dispatcher/WishlistDispatcher/_syncWishlistWithBE/fetchQuery/then deconstruction of discount is incorrect:
minimum_price: { discount = 0 } = {}, discount is an object, not a value;
Should be { discount = {} } = {}

Also - in Util/Wishlist/getPriceRange in the regular price property final price value is passed, so only the final price is rendered.
Suggested solution:

    const priceCurrencyValue = { value: price, currency };
    const priceCurrencyValueExclTax = { value: priceWithoutTax, currency };
    const priceCurrencyRegularValue = { value: regularPrice, currency };
    const priceCurrencyRegularValueExclTax = { value: regularPriceExclTax, currency };
    const priceSection = {
        final_price: priceCurrencyValue,
        regular_price: priceCurrencyRegularValue,
        final_price_excl_tax: priceCurrencyValueExclTax,
        regular_price_excl_tax: priceCurrencyRegularValueExclTax,
        default_final_price_excl_tax: priceCurrencyValueExclTax,
        discount
    };

PWA version: 5.3.6