Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

how to hide shopping cart widget altogether when empty?

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › how to hide shopping cart widget altogether when empty?

Tagged: Cart Widget Tweak, hide widget

  • This topic has 1 reply, 2 voices, and was last updated 15 years, 6 months ago by amin007.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • November 11, 2009 at 9:39 pm #417
    pikatore
    Member

    i only want the widget to appear on the side when a product is added, and to disappear if all products are unselected. how do i do this?

    November 12, 2009 at 2:09 am #15947
    amin007
    Participant

    Update: The post has an easier method of only showing the cart when there are items in it:

    https://support.tipsandtricks-hq.com/forums/topic/estore-want-to-hide-empty-cart-widget


    Find the following bit of code in “wp_eStore1.php” file (this is what displays the widget):

    function show_wp_digi_cart_widget($args)
    {
    extract($args);

    $cart_title = get_option('wp_eStore_widget_title');
    if (empty($cart_title)) $cart_title = 'Shopping Cart';

    echo $before_widget;
    echo $before_title . $cart_title . $after_title;
    echo print_wp_digi_cart();
    echo $after_widget;
    }

    Now add the following at the start of the function (before the line with the “extract” statement) so it doesn’t display the widget if there are no items in the shopping cart:

    if (!digi_cart_not_empty())
    {
    return;
    }

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ