I am trying to get the configurable product’s special price or final price inside a plugin class. I already tried the below methods but it will not fetch any special price or final price of the configurable product’s data. Also, I tried to view configurable product’s simple product data using its type instance used products but I couldn’t find any special or final price data in its simple products as well.
1. Using MagentoCatalogModelProduct $product $product = $this->product->load($item('product_id')); $specialPrice = $product->getSpecialPrice(); $finalPrice = $product->getFinalPrice(); 2. Using MagentoCatalogModelProductRepository $productRepository $product = $this->product->getProductById($item('product_id')); $specialPrice = $product->getSpecialPrice(); $finalPrice = $product->getFinalPrice();
FYI – Also, I checked in $product->getData() as well but only available the price value which doesn’t have the special price or final price
Expected result: Get the special or final price value and passed it to an email template content variables inside the plugin class function. This special price value correctly showing on the configurable product details page.
Actual result: null or 0 shows as the get data
Could you please let me know your thoughts? Is there any other way to get the special or final price of the configurable product inside a plugin class?