How can I get Original price and Final price of given below types product?
- Simple product
- Configurable product
- Bundle product
- Group product
For simple product I can get price easily using below code.
$finalPrice = $product->getFinalPrice(); $originalPrice = $product->getPrice();
But I am not able to get Original price and Final price for Configurable product, Bundle product, Group product
Is there any easy way to get both prices of all other types of product.
I get price Original price and Final price of configurable product using below code. and take reference from get-price-range-configurable-product-magento-2
$basePrice = $product->getPriceInfo()->getPrice('regular_price'); $regularPrice = $basePrice->getMinRegularAmount()->getValue(); $specialPrice = $product->getFinalPrice();
Any help would be appreciated! Thanks.