From ded09e3044c3d577c36e3858e47c44d6d5a03ccc Mon Sep 17 00:00:00 2001 From: falkone Date: Fri, 3 Nov 2017 13:33:41 +0100 Subject: [PATCH] Update Data.php to fix BasePrice on config Product Magneto deliver different prices for $product->getFinalPrice() or $product->getPriceInfo()->getPrice('final_price')->getValue(); The Problem is for config products on getFinalPrice the "Dummy" price of parent is delivert and not the minimum price of the children. "Dummy" price means when you create an config product you have to set an price for the parent because it is an requiered field. Normaly the "Dummy" price is not shown on frontend. --- Helper/Data.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Helper/Data.php b/Helper/Data.php index 23b071b..b268c7d 100644 --- a/Helper/Data.php +++ b/Helper/Data.php @@ -126,6 +126,10 @@ public function getReferenceAmount(\Magento\Catalog\Model\Product $product) public function getBasePrice(\Magento\Catalog\Model\Product $product) { $productPrice = $product->getFinalPrice(); + + if ($product->getTypeId() == "configurable") + $productPrice = $product->getPriceInfo()->getPrice('final_price')->getValue(); + $conversion = $this->getConversion($product); $referenceAmount = $product->getData('baseprice_reference_amount'); $productAmount = $product->getData('baseprice_product_amount');