How To Add Custom Text On Cart Page In WooCommerce

How to add custom text on the cart page in Woocommerce
730 Views

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

text on add to cart page 1
<?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

text on add to cart page
<?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.

Was this article helpful?
YesNo

Leave a comment

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