Skip Navigation

[Resolved] Unable to override CSS of [wpv-woo-buy-or-select] Button

This support ticket is created 4 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Our next available supporter will start replying to tickets in about 4.68 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Luo Yang 4 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1769529
Screenshot 2020-09-08 at 16.00.05.png
Screenshot 2020-09-08 at 15.58.38.png
Screenshot 2020-09-08 at 15.58.33.png

I had previously been using [wpv-woo-buy-or-select show_quantity_in_button='yes' add_to_cart_text='Add to Basket'] with:
1) AJAX Add to Cart ENABLED; and
2) Redirect to Cart on successful addition DISABLED

I was using the above in conjunction with the styling below, which was working as expected.

button.add_to_cart_button {
	background-color: var(--success) !important;
	color: white !important;
	padding: 8px 20px;
	border: none;
	font-size: 1em;
}
button.add_to_cart_button:hover {
  background-color: #00529f !important;
}

I am now using [wpv-woo-buy-or-select show_quantity_in_button='yes' add_to_cart_text='Add to Basket'] with
1) AJAX Add to Cart DISABLED; and
2) Redirect to Cart on successful addition ENABLED.

This has changed the classes of the Add to Cart button (see screenshots, it now has .button .alt NOT button.add_to_cart_button) and I have been unable to target it with CSS.

I have tried a number of combinations of the below CSS in both style.css and woocommerce.css but with no luck.

form > button { 
  background-color: #1da647 !important;
  color: white !important;
  padding: 1rem !important;
  border-radius: 5px !important;
}
form.cart > button { 
  background-color: #1da647 !important;
  color: white !important;
  padding: 1rem !important;
  border-radius: 5px !important;
}

Please can you advise on how I can customise the style of this button.

#1769593

I am able to fix this issue by adding the class .add_to_cart_button directly in the WooCommerce Views plugin file, because creating an override copy in my theme did not work.

Is there a way to do this without directly editing the WooCommerce Views plugin file?

#1770087

Hello,

I don't think you need to hack plugin files, you can try below CSS selector:

button.button.alt {
/** here setup your custom CSS codes **/
}
button.button.alt:hover {
/** here setup your custom CSS codes **/
}