Hi Stephen,
Thanks for reaching out to us. Will you please give me a screenshot so that I can understand it clearly?
BTW, please upload your screenshot here- https://paste.pics/ and post directly the screenshot link in this thread.
Thank you
Hi Stephen,
Thanks for reaching out to us. Will you please give me a screenshot so that I can understand it clearly?
BTW, please upload your screenshot here- https://paste.pics/ and post directly the screenshot link in this thread.
Thank you
Hi I have an image here:
https://paste.pics/f69b330c4cec8858b6f9b825c7273e1f
Basically, I want to style a variation div differently if it’s on sale.
Thank you
Hi Stephen,
Unfortunately, you can’t add data-attribute right now.
However, you can add additional CSS selectors using this filter- woo_variation_swatches_variable_item_css_class
I hope it will help.
Thank You
Hi Hakik
Thank you but where would I start with this?
Kind regards
Hi Stephen,
Please check the following snippet as a reference:
add_filter('woo_variation_swatches_variable_item_css_class', function( $get_item_css_classes, $data, $attribute_type, $variation_data){
$get_item_css_classes[] = 'i_am_hakik';
return $get_item_css_classes;
}, 10, 4);
Then you will get a class like this- https://prnt.sc/YtgqR_3_bAbE
I hope it helps.
Thank You
Thank you for that.
OK I can understand how to add a class but how would I target a specific variation to style (if it is on sale)
For example here:
https://ccktech.com/product/sandisk-professional-g-drive-2/
Variation 12TB is on sale.
Thank you
Hi Stephen,
This is the utmost I can do for you.
Rest of the things you have to do yourself or you should hire a developer.
I hope I could clear up your confusion.
Thank You
Style an attribute label differently if on sale
Stephen Currey
Hi there,
We are currently using the Pro version of this plugin.
Is there any way to style an attribute label differently when on a product page? We could style it ourselves but I cannot see where to add another data attribute to the variation or how we would go about doing so.
Thanks in advance!