![](https://www.wp-centrics.com/wp-content/uploads/triggering-popup-cart-notices-1.jpg)
In this post, we will cover how to set cart notices with buttons, with call to actions that can be links to other pages, or trigger a 3rd party popup (from another plugin).
As we saw in this previous post: “Custom cart messages on WooCommerce“, using the Fish and Ships special action “Show notice message” we can show messages under the necessary conditions.
Table of Contents
We can add cart notices with button by simply adding a bit of HTML code into it. First, we must add the rule, with the needed conditions, and the special action: “Show notice message”:
![Rule for cart notices with button](https://www.wp-centrics.com/wp-content/uploads/rules-cart-notices-with-button.jpg)
And here the HTML code for the button inside the cart notice message:
![The HTML code for cart notices with button](https://www.wp-centrics.com/wp-content/uploads/message-cart-notices-with-button.jpg)
Here the result. Please, note that we’re using for this demonstration the default Storefront theme for WooCommerce, using his own “button” class for buttons on the cart notices:
![The result for cart notices with button](https://www.wp-centrics.com/wp-content/uploads/storefront-cart-notices-with-button.jpg)
Maybe your theme use another classname for buttons, or maybe you want to stylize it. In this case, we will give you an example at the bottom of this post, please, continue reading đ
Button in cart notices that opens a popup
Maybe you want to give more information about the cart notice to your customers. Or maybe you want to give a contact form in a popup, instead of send your customers to the contact page. Or maybe you want to offer a login into popup for your B2B products. There is infinite possiblities.
With the WordPress Popup plugin you can easily add a popup. There is a free version on WordPress repository, and a premium one with amazing extra features, like contact or login forms.
Here we will define a simple popup:
![Popup button in cart notices](https://www.wp-centrics.com/wp-content/uploads/popup-button-in-cart-notices.jpg)
Ensure that will show on all pages, and set the key feature: the class that the plugin will looking for to open the popup, in our example “.launch_popup_box”:
![The CSS selector in cart notices button for triggering the popup](https://www.wp-centrics.com/wp-content/uploads/opening-popup.jpg)
Now we will put this class into our button code. The Popup plugin will lookin for this class:
![The button in cart notices will trigger the popup on click](https://www.wp-centrics.com/wp-content/uploads/triggering-popup-cart-notices-1.jpg)
And here the result: When our customer click on the more info button, the popup is shown. You can put whatever you want in the popup: more information, contact form, login form, etc.
![Cart notices with button that opens a popup](https://www.wp-centrics.com/wp-content/uploads/popup-cart-notices.jpg)
You can style your buttons using custom CSS. In our example, we will modify the Storefront buttons in the cart notices. You can create more than one custom class. Please note that there are three different types of messages: message, info and error.
In wp-admin side, go to Apparence > Customize > Additional CSS. You will be able to see the changes live:
![Cart notices with button customised](https://www.wp-centrics.com/wp-content/uploads/customise-button-in-cart-notices.jpg)
Here the CSS code on our example:
.woocommerce-message .button,
.woocommerce-info .button,
.woocommerce-error .button {
background: #fff;
color: #333;
border-radius: 5px;
padding: 0 10px;
border: 0;
}
.woocommerce-message .button:hover,
.woocommerce-info .button:hover,
.woocommerce-error .button:hover {
background: #333;
color: #fff;
}