Show WooCommerce Store Notice for Existing Customers Only

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.

Show WooCommerce Store Notice for Customers Only

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.

Screenshots

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.

WooCommerce Demo Site Screenshot For Customers (Store Notice Visible)
WooCommerce Demo Site Screenshot For Customers (Store Notice Visible)
WooCommerce Demo Site Screenshot For Non Customers (No Store Notice)
WooCommerce Demo Site Screenshot For Non Customers (No Store Notice)

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.

SHARE YOUR LOVE
Default image
Kim Coleman

Hi! I'm Kim Coleman, an internet entrepreneur from Reading, PA. I've been working with WordPress for over 15 years. In 2011, I founded Paid Memberships Pro, a complete plugin for Recurring Subscriptions and Content Restriction with 100k active sites. I'm currently working on our new product, Sitewide Sales.

Articles: 27