---
title: "How to Add Placeholder Text in Field for Checkout in Magento 2"
url: "https://dolphinwebsolution.com/how-to-add-placeholder-text-in-field-for-checkout-in-magento-2"
date: "2021-10-13T06:11:34+05:30"
modified: "2023-08-25T09:17:29+05:30"
author:
  name: "Divyesh Dusara"
categories:
  - "Magento"
word_count: 294
reading_time: "2 min read"
summary: "Today we learn How to Add Placeholder text in field for checkout page in Magento 2.

At checkout page there are no placeholder text by default in any filed. so when if you want to add placeholder..."
description: "Today we learn How to Add Placeholder text in field for checkout page. At checkout page there are no placeholder text by default in any filed. so when if you..."
keywords: "Add Placeholder Text in Field for Checkout,Add Placeholder Text in Field in Checkout magento 2,magento 2 Add Placeholder Text in Field in Checkout,Add Placeholder Text in Magento 2,Add Placeholder Text in Checkout,Add Placeholder Text in Checkout in magento 2, Magento"
language: "en"
schema_type: "Article"
related_posts:
  - title: "Add Store View in Admin UI Grid For Magento 2"
    url: "https://dolphinwebsolution.com/add-store-view-in-admin-ui-grid-for-magento-2"
  - title: "How To Add Split Button on Admin Page in Magento 2"
    url: "https://dolphinwebsolution.com/how-to-add-split-button-on-admin-page"
  - title: "How to Get System Configurations All CMS Pages In Magento 2"
    url: "https://dolphinwebsolution.com/how-to-get-system-configurations-all-cms-pages-in-magento-2-2"
---

# How to Add Placeholder Text in Field for Checkout in Magento 2

_Published: October 13, 2021_  
_Author: Divyesh Dusara_  

![](https://dolphinwebsolution.com/wp-content/uploads/2021/10/How-to-Add-Placeholder-Text-in-Field-for-Checkout-in-Magento-2-1024x536.png)

Today we learn How to Add Placeholder text in field for checkout page in Magento 2.

At checkout page there are no placeholder text by default in any filed. so when if you want to add placeholder text into checkout page you need to follow below steps. its very use usefull when some time we just need to display placeholder as per client requirement

Here we have one custom module name Dolphin HelloWord

After you need to create one [di.xml](https://magento.stackexchange.com/questions/111845/magento-2-what-case-i-use-di-xml-and-how-to-use-di-xml-for-module) file as below

**app/code/Dolphin/HelloWord/etc/frontend/di.xml**

```
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
     <type name="Magento\Checkout\Block\Checkout\AttributeMerger">
          <pluginname="add_placeholderto_checkout" type="Dolphin\Helloworld\Plugin\Block\Checkout\AttributeMerger" sortOrder="10"/>
     </type>
</config>
```

**app/code/Dolphin/HelloWord/Plugin/Block/Checkout/AttributeMerger.php**

```
<?php
namespace Dolphin\HelloWord\Plugin\Block\Checkout\;

/**
* Class AttributeMerger
* @package Dolphin\HelloWord\Plugin\Block\Checkout\AttributeMerger
*/
class AttributeMerger
{
     /**
     * @param \Magento\Checkout\Block\Checkout\AttributeMerger $subject
     * @param $result
     * @return mixed
     */
     publicfunctionafterMerge(\Magento\Checkout\Block\Checkout\AttributeMerger $subject,$result)
     {
          $result['firstname']['placeholder'] = __('First Name');
          $result['lastname']['placeholder'] = __('Last Name');
          $result['street']['children'][0]['placeholder'] = __('Address 1');
          $result['street']['children'][1]['placeholder'] = __('Address 2');
          $result['city']['placeholder'] = __('Enter City');
          $result['postcode']['placeholder'] = __('Enter Zip/Postal Code');
          $result['telephone']['placeholder'] = __('Enter Phone Number');
          return $result;
      }
}
```

After that, you just need to clear the cache and you can check on your checkout page. so you can add as you need in any field in checkout page.

Like to read: [Custom validation checkout for magento 2](https://dolphinwebsolution.com/magento-2-add-custom-validation-checkout)

That’s it!

I hope this blog helps you. If you have any further queries regarding this blog write your query in the comment section.


---

_View the original post at: [https://dolphinwebsolution.com/how-to-add-placeholder-text-in-field-for-checkout-in-magento-2](https://dolphinwebsolution.com/how-to-add-placeholder-text-in-field-for-checkout-in-magento-2)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-26 06:55:34 UTC_  
