Message above cart - by teolivier - on WordPress WooCommerce support

This topic has 3 replies, 2 voices, and was last updated 5 years ago ago by Rose Tyler

  • Avatar: teolivier
    teolivier
    Participant
    December 17, 2020 at 08:02

    For better visibility how can we add html text message above cart on cart page?

    Please, contact administrator
    for this information.
    2 Answers
    Avatar: teolivier
    teolivier
    Participant
    December 17, 2020 at 08:03

    We want to display the red message that is now below cart but put it above the cart:

    Please Note!
    Backorder items will only be processed starting on the 4th of January 2021!
    In-stock items will be shipped subject to the availability of courier services.

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    December 17, 2020 at 08:15

    Hello,

    You can use woocommerce_cart_is_empty and woocommerce_cart_is_empty actions

    https://developer.wordpress.org/themes/advanced-topics/child-themes/

    something like this

    child-theme/functions.php

    add_action('woocommerce_cart_is_empty', function() {
    echo '<div class="woocommerce-error">Your text here</div>';
    });

    Regards

  • Viewing 3 results - 1 through 3 (of 3 total)

The issue related to '‘Message above cart’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.