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.