---
title: "How to display “Free” for product with $0.00 price in Magento 2"
url: "https://magecomp.com/blog/how-to-display-free-for-product-with-zero-price-in-magento-2/"
date: "2018-04-09T17:26:39+00:00"
modified: "2025-06-05T12:41:18+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "Magento 2"
word_count: 455
reading_time: "3 min read"
summary: "Offering discounts for your online Magento store can be a powerful weapon to drive conversions &amp; customer loyalty. But, besides of that offering free product or services can drastically make an..."
description: "Everyone loves the word 'FREE' that gets most people’s blood pumping. Instead of zero pricing product, 'FREE' phrase can help you to grab your customer's a..."
keywords: "Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Magento 2: Add Readonly Field in ui_component Form"
    url: "https://magecomp.com/blog/magento-2-add-readonly-field-in-ui-component-form/"
  - title: "The Top-Rated Facebook Shop Integration Extension with Magento 2"
    url: "https://magecomp.com/blog/best-facebook-shop-integration-extension-for-magento-2/"
  - title: "Magento 2: How To Redirect 404 Page Found To Search Page"
    url: "https://magecomp.com/blog/redirect-404-page-found-to-search-page/"
---

# How to display “Free” for product with $0.00 price in Magento 2

_Published: April 9, 2018_  
_Author: Dhiren Vasoya_  

![Magento 2 Display Free for product with price of 000](https://magecomp.com/blog/wp-content/uploads/2018/04/Magento-2-Display-Free-for-product-with-price-of-000-1024x332.webp)

Offering discounts for your online Magento store can be a powerful weapon to drive conversions & customer loyalty. But, besides of that offering free product or services can drastically make an impression on customer mind.

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-2.webp)](https://magecomp.com/magento-malware-removal.html)

Even some online stores are likely to give the free samples or products to turn their excitement
level up, that makes customer feeling like they’re getting in on something
exclusive and unique. From a business perspective, free stuff is often much
more powerful, and much cheaper than traditional advertising. It’s a simple,
yet useful technique to garners traffic and hook customers as well as encourage
them to make a purchase.

Everyone loves the word ‘FREE’ There’s something about getting free stuff that gets most people’s
blood pumping. Instead of zero pricing product, ‘FREE’ phrase can
help you to grab your customer’s attention easily. That’s why Today I am again
back with a small piece of code that will help you to display “Free” for the
product with $0.00 price of in Magento 2.

[![Magento 2 Speed & Performance Optimization Services](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Speed-Performance-Optimization-Services-CTA-2.webp)](https://magecomp.com/magento-performance-optimization.html)

We need to create **“default.phtml”** file inside extension the below directory

**app\design\frontend\Themes\Yourtheme\Magento_Catalog\templates\product\price\amount**

```

<?php if ($block->getDisplayValue() != 0 ) { ?>
escapeHtmlAttr($block->getAdjustmentCssClasses()) ?>"
    <?= $block->getSchema() ? ' itemprop="offers" itemscope itemtype="http://schema.org/Offer"' : '' ?>>
    <?php if ($block->getDisplayLabel()) :?>
        <?= $block->escapeHtml($block->getDisplayLabel()) ?>    <?php endif; ?>
    getPriceId()) :?> id="<?= $block->escapeHtmlAttr($block->getPriceId()) ?>"<?php endif;?>
        <?= ($block->getPriceDisplayLabel()) ? 'data-label="' . $block->escapeHtmlAttr($block->getPriceDisplayLabel() . $block->getPriceDisplayInclExclTaxes()) . '"' : '' ?>
    data-price-amount="<?= $block->escapeHtmlAttr($block->getDisplayValue()) ?>"
    data-price-type="<?= $block->escapeHtmlAttr($block->getPriceType()) ?>"
    class="price-wrapper <?= $block->escapeHtmlAttr($block->getPriceWrapperCss()) ?>"
    ><?= $block->escapeHtml($block->formatCurrency($block->getDisplayValue(), (bool)$block->getIncludeContainer()), ['span']) ?>        <?php if ($block->hasAdjustmentsHtml()) :?>
        <?= $block->getAdjustmentsHtml() ?>
    <?php endif; ?>
    <?php if ($block->getSchema()) :?>
<meta itemprop="price" content="<?= $block->escapeHtmlAttr($block->getDisplayValue()) ?>" />
<meta itemprop="priceCurrency" content="<?= $block->escapeHtmlAttr($block->getDisplayCurrencyCode()) ?>" />
    <?php endif; ?>
<?php } else { ?>
<?= __("Free") ?>
<?php } ?>
```

And that’s it! Now check the price in store frontend and now it will be displayed as “free” instead of “$0.00” amount in your store frontend.
If you are looking for any help regarding above-mentioned code please comment down below.

[![hyva theme development](https://magecomp.com/blog/wp-content/uploads/2025/02/hyva-theme-development-CTA-2.webp)](https://magecomp.com/services/hyva-theme-development/)
Happy coding!


---

_View the original post at: [https://magecomp.com/blog/how-to-display-free-for-product-with-zero-price-in-magento-2/](https://magecomp.com/blog/how-to-display-free-for-product-with-zero-price-in-magento-2/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-09-26 08:28:02 UTC_  
