Show "your cart is empty" on shopping cart widget (3 posts)

  1. dominik01
    Posted 2 years ago #

    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


  2. Elina
    Posted 2 years ago #

    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>';
  3. stof77
    Posted 2 years ago #

    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) ?

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic