How To Add Custom Text On Cart Page In WooCommerce

How to add custom text on the cart page in Woocommerce
795 Views
4.3
(651)

In this tutorial, we will focus on one particular aspect of customization: adding custom text on the cart page.

The cart page is a crucial step in the customer’s journey, where they review the products they have added to their cart before proceeding to checkout. By adding custom text to this page, you can provide important information, promotional messages, or any other content that enhances the shopping experience for your customers.

Step 1: Add Custom Text After Cart Table

<?php
add_action('woocommerce_before_cart_collaterals', 'cxc_cart_page_custom_text_call_back');
function cxc_cart_page_custom_text_call_back() { ?>
	<div class="cxc-cart-custom-note">	
		<h2>Delivery Note</h2>
		<p align="justify">Please be aware that responding to your complaint might take longer than normal. The option to phone us is not accessible from 10:00 PM to 5:00 AM, however we are working hard to fulfil your request and appreciate your patience and understanding.</p>
	</div>
	<?php
	return $message;
}
?>

Step 2: Add Custom Text After Cart Table

<?php
add_action('woocommerce_before_cart_contents', 'cxc_cart_before_page_custom_text_call_back');
function cxc_cart_before_page_custom_text_call_back() { ?>
	<div class="cxc-cart-custom-note">	
		<h2>Delivery Note</h2>
		<p align="justify">Please be aware that responding to your complaint might take longer than normal. The option to phone us is not accessible from 10:00 PM to 5:00 AM, however we are working hard to fulfil your request and appreciate your patience and understanding.</p>
	</div>
	<?php
	return $message;
}
?>

Throughout this tutorial, we have explored the step-by-step process of adding custom text on the cart page in WooCommerce.

By leveraging the platform’s extensive plugin ecosystem and user-friendly interface, you can easily implement this customization without requiring extensive coding knowledge or technical expertise.

How useful was this blog?

Click on a star to rate it!

Average rating 4.3 / 5. Vote count: 651

No votes so far! Be the first to rate this blog.

  • CodexCoach

    - Web Development Expert

    CodexCoach is a skilled tech educator known for easy-to-follow tutorials in coding, digital design, and software development. With practical tips and interactive examples, CodexCoach helps people learn new tech skills and advance their careers.

By Subhash Katakiya

Hey Guys, My Self Subhash Katakiya. I am a resident of Gujarat. I have 2+ years of experience in full-stack web development. Currently, I am working in CodexCoach Company. In particular, I specialize in WooCommerce, plugins, and themes. So, read my blogs and learn full-stack web development skills with my guide.

Leave a comment

Your email address will not be published. Required fields are marked *