0

I was trying to modify the empty cart message in woocommerce code, but when I make any change nothing happens in the theme (website)!

<div class="empt-container-cta">
    <a class="btn" href="<?php echo esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ); ?>">
                         <?php esc_html_e('your cart is empty Go Shopping') ?> <i class="ion ion-right ion-ios-arrow-forward"></i>
    </a>
</div>
Axe319
  • 4,255
  • 3
  • 15
  • 31
netrowex
  • 31
  • 1
  • 5

1 Answers1

0

Put this below code in active theme functions.php

remove_action( 'woocommerce_cart_is_empty', 'wc_empty_cart_message', 10 );
add_action( 'woocommerce_cart_is_empty', 'my_custom_empty_cart_message', 10 );
function my_custom_empty_cart_message() {
    $html = '<a class="btn" href="'.esc_url( apply_filters( 'woocommerce_return_to_shop_redirect', wc_get_page_permalink( 'shop' ) ) ).'">';
        $html .= esc_html_e('your cart is empty Go Shopping').'<i class="ion ion-right ion-ios-arrow-forward"></i>';
    $html .= '</a>';
    echo $html;
}
Bhautik
  • 11,125
  • 3
  • 16
  • 38