fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Feature request: Add selector to DIV

Hi,

Great plugin!

You should add a selector to this div. This would help when styling in woocommerce.

File: woo-variation-swatches/includes/class-woo-variation-swatches-product-page.php

Line: 67

 

//echo sprintf( '<div %s>', wc_implode_html_attributes( $attributes ) ); // WPCS: XSS ok. );
echo sprintf( '<div class="ClassName" %s>', wc_implode_html_attributes( $attributes ) ); // WPCS: XSS ok. );

 

 

Hakik Zaman

Hi Petter,

Thanks for reaching out to us. Please add the following snippet using the Code Snippets plugin or add the following snippet inside your current/child theme’s functions.php:

add_filter( 'woo_variation_swatches_single_product_wrapper_attributes', function( $array, $product ){
$array['class'] = "YOUR_CLASS"; //Add your class name here
return $array;
}, 10, 2);

Please add your own class name as you want. I have already kept a note inside the snippet to add your own class.

Hope to hear from you soon.

Thank You