I'm trying to work with a template on a bookstore site (M2.3.6). I added a new configurable product with 2 configurations and when I did, I got this error:
Error filtering template: Warning: Division by zero in /home2/crippenl/public_html/magento/app/design/frontend/Sm/amabook/Sm_RecentlyViewed/templates/slider-v2.phtml on line 101
The code is:
getProductPrice($_product) ?> getPrice(); $finalPrice = $_product->getFinalPrice(); $save_percent = 100 - round(($finalPrice / $defaultPrice) * 100); if ($finalPriceAny thoughts on this? I've been working on this for hours with no luck. Thank you.
$defaultPrice
has some value ? As well as you could either use$block->getProductPrice($_product)
or$block->getPrice()
in your template file.