1

/magento-catalog/templates/product/price/final_price.phtml

<span class="old-price">
    <?php /* @escapeNotVerified */ 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,
        'economy_settings'  => $block->getEconomySettings()
    ]); ?>
</span>

Function $block->hasSpecialPrice() looks like

public function hasSpecialPrice()
{
    $displayRegularPrice = $this->getPriceType(Price\RegularPrice::PRICE_CODE)->getAmount()->getValue();
    $displayFinalPrice = $this->getPriceType(Price\FinalPrice::PRICE_CODE)->getAmount()->getValue();
    return $displayFinalPrice < $displayRegularPrice;
}

How can i find what cause discount to this product. For example i want to know what price rule discount is percentage or value. it could be price rule for product catalog or price rule for cart. Any ideas? Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.