I want to get the original price of a Bundle product (Minimal/Maximal one).
This needs to replicate what Magento is grabbing for the WAS price below so I can add a percentage off to product pages.
I can get the Special Price like below:
$bundleObj=$product->getPriceInfo()->getPrice('final_price');
echo $bundleObj->getMinimalPrice();// For min price
echo $bundleObj->getMaximalPrice(); // for max price
I've tried using the below but this just returns 0:
$_product->getPrice();
This also only has both with and without tax and the standalone tax:
print_r($_product->getPriceInfo()->getPrice('final_price')->getMinimalPrice());
Have also looked at:
$_product->getPriceModel()->getTotalPrices($_product,'min',1)
This seems to just be pulling similar data cannot get the original price.
Best Answer
After studying a lot of files containing the
old-price
tag similar to that used in the markup for the WAS price, I found the below:I figured it made sense to use
regular_price
instead offinal_price
and so used similar code in my block to get the original price:So after playing a little bit I can confirm how to get the following prices:
Regular Minimal Price:
Regular Maximal Price:
Special Minimal Price:
Special Maximal Price:
These are all including the tax to get the value excluding tax change
getValue()
togetBaseAmount();
.e.g: