public function __construct(
    Context $context,
    \Magento\Catalog\Model\ProductFactory $productFactory
) {
    $this->productFactory = $productFactory;

$products = $this->productFactory->create()
            ->addAttributeToFilter('status', 1)
            ->addAttributeToFilter('visibility', '4');
foreach($products as $product)
$finalprice =($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE)?
                            $product->getPriceInfo()->getPrice('final_price')->getAmount()->getValue(). ' ' . $currency:
                            $product->getFinalPrice() . ' ' . $currency;//price but not FINAL

I have in Catalog Price Rule some rules for products in the category. How can I get the last price? I would like to have both prices (249,00€ and 124,50€) enter image description here

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.