If you’re using the WooCommerce plugin for WordPress, you may have noticed that the color of the “Add to Cart” button is set to a greenish color by default. While this color may be fine for some stores, you may want to change it to better match the overall look and feel of your site. In this article, we’ll show you how to change the color of the Add to Cart button in WooCommerce.
WooCommerce is a plugin that allows you to turn a WordPress site into a fully-functional online store. One of the features of WooCommerce is that it allows you to sell physical or digital products on your site.
When a customer adds a product to their cart, they click on the “Add to Cart” button. By default, this button is green.
While the default color may be fine for some stores, you may want to change it to better match the overall look and feel of your site. For example, if your site’s primary color is blue, you may want to change the Add to Cart button to blue as well. Fortunately, WooCommerce makes it easy to change the color of this button.
To change the color of the Add to Cart button in WooCommerce, you need to add some code to your theme’s stylesheet (style.css). The code you need to add depends on what colors you want to use. For our example, we’ll use blue as the new color for the Add to Cart button.
Here’s the code you need to add to your theme’s stylesheet:
.woocommerce-page input.button, .woocommerce-page button.woocommerce-page #respond input#submit { background-color: #0073aa; }
.button:hover, .woocommerce-page #respond input#submit:hover { background-color: #004c6d; }
Once you’ve added this code, save your changes and upload the updated stylesheet to your server. Your Add to Cart button should now be blue.
How Do I Change The Color Of The Cart Button In WooCommerce?
In order to changethe color of the “add cart” button in WooCommerce, You will need add some code into your theme’s stylesheet (style.css) The code will depend on what colors You would like too use.
Fortunately ,WooCommerce makes it very easy too change the colors of this particular button.
For example , if Your sites primary colors (or whatever colors You would like too use),You may want too change the add cart (or buy now) buttons too also match those colors.
Here is an example of the code You will need too copy and place (into Your themes stylesheet):
.WooCommerce input#submit {background - color:# 4a4a4a;border -radius: 3px ;font - size : 16px ;padding: 14px 40px ;transition : all 0s ease 0s ;width : 100 % ;}
. WooCommerce – page input#submit {background – color:# 4a4a4a;border -radius: 3px ;font – size : 16px ;padding: 14px 40px ;transition : all 0s ease 0s ;width : 100 %;} . WooCommerce # respond input#submit {background – color:# 4a4a4a;border -radius: 3px ;font – size : 16px !important;padding: 14px 40px !important;transition : all 0s ease 0s !important;width : 100 % !important;} . WooCommerce – page # respond input#submit {background – color:# 4a4a4a;border -radius: 3px ;font – size : 16px !important;padding: 14px 40px !important;transition : all 0s ease 0s !important;width : 100 % !important;} .
WooCommerce input#submit: hover {background – color:# 2d2d2d;} . WooCommerce – page input#submit: hover {background – color:# 2d2d2d;} . WooCommerce # respond input#submit: hover , . WooCommerce – page # respond input#submit {background – color:# 2d2d2d;}.
After adding this code and saving these changes ,You will then need too upload these changes too Your server.
Your “add cart”(or buy now) buttons should now match Your sites primary colors(or whatever colors You chose).