Skip Navigation

[Resolved] Help styling [wpv-woo-buy-or-select] button

This thread is resolved. Here is a description of the problem and solution.

Problem:

Can I change the look of the [wpv-woo-buy-or-select] button?

Solution:

It is a custom CSS codes problem, for example:
https://toolset.com/forums/topic/help-styling-wpv-woo-buy-or-select-button/#post-1226566

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select

This support ticket is created 5 years, 8 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.

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 liatG 5 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#1214503
Screenshot_Liat 2019-03-14 at 7.29.43 PM.jpg

Hello,
Can I change the look of the [wpv-woo-buy-or-select] button?

Here is a link to the page it is displayed on (shop page): hidden link
Here is the loop content for the view:

<p style="text-align: center;"><a href="[wpv-post-url]">[types field='product-image' title='[wpv-post-title]' alt='%%ALT%%' align='center' size='custom' height='200' resize='proportional'][/types]</a><b><a href="[wpv-post-url]">[types field='short-title'][/types]</a></b><br />$[types field='views_woo_price'][/types]<br><br>[wpv-woo-buy-or-select]</p>

I would like to use CSS to make the button narrower and have a different initial (non-hover) color. Right now the button is quite distracting.

I tried [wpv-woo-buy-or-select class="narrow"] with custom CSS for "narrow" but nothing changed.

Thank you!
Liat

#1214518

Hello,

Shortcode [wpv-woo-buy-or-select] does not support "class" attribute, see our document:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-woo-buy-or-select

In your case you can setup the CSS codes like this:

a.ajax_add_to_cart{
/* here setup your custom CSS codes*/
}
#1226566

Thanks Luo.

I was able to use the Firefox "Inspect Element" feature to find the CSS that was being applied to the button.
I added this to my CSS code:

.woocommerce a.button {
padding: .5em .6em;
margin-top: .2em;
}

I'm learning!! 😀
Thanks,
Liat