WooCommerce includes a basic “Store Notice” so shops can show a notification banner to site visitors. In this tooltip, we should you a few lines of custom code to only show the notice to existing customers. Use this method as a simple way to give “Repeat Customers” access to special deals.
The Code Recipe
Adding the Recipe to Your Website
You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. We have a post on how to create a customizations plugin on our partner website, Paid Memberships Pro.
Below are screenshots of the demo site with the code recipe active. This demonstrates how the Store Notice is shown for logged in customers only (for any user that has the
customer role) and hidden for everyone else.
Leverage The sitewide sales Plugin For More Features
This recipe shows a simple way to hide the WooCommerce Store Notice. If you need more robust sitewide sale banners and notification bars, try the Sitewide Sales plugin—it works with WooCommerce and other popular ecommerce plugins for WordPress.