Support » Plugin: WooCommerce » Show "your cart is empty" on shopping cart widget

  • Hi in options of shopping cart widget there is option to hide a shopping cart if it is empty. However I dont want to hide it but I want to make some text like “Your cart is empty” appear. Now it just says your shopping cart without any message.
    I didnt find anything in options so I tried some php modification but I didnt solve it by myself.

    Please help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Elina


    You can make it by editing the widget cart php file. Go to plugins > woocommerce > classes > widgets. Open class-wc-widget-cart.php file.
    Go to line 70 or so and find this part of code and place your message just like shown below:

    // Insert cart widget placeholder - code in smtcommerce.js will update this on page load
    echo '<div class="widget_shopping_cart_content">EMPTY CART OR WATEVER MESSAGE YOU WANT</div>';

    Sorry to the jump into this topic, but as I have the exact same problem with the cart widget, I just tested succesfully your solution,

    so thank you elina-cristina, though I found it strange that there is not a default message for the empty cart, or maybe there is and for any reason, it wasn’t working (using a french version of WP btw) ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show "your cart is empty" on shopping cart widget’ is closed to new replies.