public function setItemPriceFormatted(array &$item, $price_model, $currency = null)
    {
        if (!isset($currency)) {
            $currency = $item['currency'];
        }

        $price = $price_model->convert($item['price'], $item['currency'], $currency);
        $item['price_formatted'] = $price_model->format($price, $currency);

        if (isset($item['original_price'])) {
            $price = $price_model->convert($item['original_price'], $item['currency'], $currency);
            $item['original_price_formatted'] = $price_model->format($price, $currency);
        }
    }
public function setItemPriceFormatted(array &$item, $price_model, $currency = null)
    {
        if (!isset($currency)) {
            $currency = $item['currency'];
        }

        $price = $price_model->convert($item['price'], $item['currency'], $currency);
        $item['price_formatted'] = $price_model->format($price, $currency);

        if (isset($item['original_price'])) {
            $price = $price_model->convert($item['original_price'], $item['currency'], $currency);
            $item['original_price_formatted'] = $price_model->format($price, $currency);
        }
    }
public function setItemPriceFormatted ( array & $ item , $ price_model , $ currency = null ) { if ( ! isset ( $ currency ) ) { $ currency = $ item [ 'currency' ] ; } $ price = $ price_model -> convert ( $ item [ 'price' ] , $ item [ 'currency' ] , $ currency ) ; $ item [ 'price_formatted' ] = $ price_model -> format ( $ price , $ currency ) ; if ( isset ( $ item [ 'original_price' ] ) ) { $ price = $ price_model -> convert ( $ item [ 'original_price' ] , $ item [ 'currency' ] , $ currency ) ; $ item [ 'original_price_formatted' ] = $ price_model -> format ( $ price , $ currency ) ; } }
Add keys with formatted prices
@param array $item
@param \gplcart\core\models\Price $price_model
@param string|null $currency
Add keys with formatted prices