Skip to main content
1 of 3
Rizwan Khan
  • 2k
  • 2
  • 18
  • 41
protected $_productRepository;

public function __construct(   
    \Magento\Catalog\Model\ProductRepository $productRepository,
) {
    $this->_productRepository = $productRepository;
}

public function getSpecialPriceById($id)
{
    $product = $this->_productRepository->getById($id);
    return $product->getSpecialPrice();
}

public function getSpecialPriceBySku($sku)
{   
    $product = $this->_productRepository->get($sku);
    return $product->getSpecialPrice();
}

call this function using block or helper as you want.

$id = '1';
$sku = 'some-ski';
$block->getSpecialPriceById($id);
$block->getSpecialPriceBySku($sku);
Rizwan Khan
  • 2k
  • 2
  • 18
  • 41