ile kaydedilen miktarı nasıl gösterebilirim Magento 2.0.2 web sitesi için katalog sayfasında kayıtlı miktarı görüntülemeye çalışıyorum. Ancak hesaplama sonucu görüntülenmiyor. Sadece boş bir yer buldum. Tema dosyasımda final_price.phtml dosyasını düzenliyorum. Lütfen bana neyin yanlış olduğunu bildir. Çoğu sonuç magento 1 ile ilgili olduğundan ve kodlar hata attığından, Google'da herhangi bir bilgi bulamadım. Hesaplamaları yapmaya çalıştığım bölümde kodumun nasıl göründüğü budur. Tavsiye takdir edildi. TeşekkürMagento 2
<span class="special-price"><span class="only-text">Only: </span>
<?php echo $block->renderAmount($finalPriceModel->getAmount(), [
'display_label' => __('Special Price'),
'price_id' => $block->getPriceId('product-price-' . $idSuffix),
'price_type' => 'finalPrice',
'include_container' => true,
'schema' => $schema
]); ?>
</span>
<br>
<span class="old-price"><span class="rrp-text">RRP: </span>
<?php echo $block->renderAmount($priceModel->getAmount(), [
'display_label' => __('Regular Price'),
'price_id' => $block->getPriceId('old-price-' . $idSuffix),
'price_type' => 'oldPrice',
'include_container' => true,
'skip_adjustments' => true
]); ?>
</span>
<span class="saving-price"><span class="saving-text">Saving: </span>
<?php
$wasPrice = $block->renderAmount($priceModel->getAmount(), []);
$nowPrice = $block->renderAmount($finalPriceModel->getAmount(), []);
if ($nowPrice < $wasPrice){
$saving = $wasPrice - $nowPrice;
echo $saving;
}
?>
</span>