/** * Get price for selection product * * @param \Magento\Catalog\Model\Product $selection * @return int|float */ public function getSelectionPrice($selection) { $price = 0; $store = $this->getProduct()->getStore(); if ($selection) { $price = $this->getProduct()->getPriceModel()->getSelectionPreFinalPrice($this->getProduct(), $selection, 1); if (is_numeric($price)) { $price = $this->pricingHelper->currencyByStore($price, $store, false); } } return is_numeric($price) ? $price : 0; }
/** * Returns price converted to current currency rate * * @param float $price * @return float */ public function getCurrencyPrice($price) { $store = $this->getProduct()->getStore(); return $this->pricingHelper->currencyByStore($price, $store, false); }