Skip to content

Sale price not formatting on front-end as expected (fix supplied!) #332

@jpcharrier

Description

@jpcharrier

The sale price is not being formatted in the front end as per the original price (ie not following the the formatting set in the options).

I believe this is due to an extra 'return' in the Product class on line 468.

Function before fix applied

    public function getFormattedSalePrice()
    {
        return
        $saleprice = $this->getProductSalePrice();

        if ($saleprice != '') {
            return StorePrice::format($saleprice);
        }
    }

Function after fix applied

    public function getFormattedSalePrice()
    {
        $saleprice = $this->getProductSalePrice();

        if ($saleprice != '') {
            return StorePrice::format($saleprice);
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions