Hello @aovivo,
We have a filter code using which you can keep a variation as a dropdown only while other variations can be styled using variation swatch options.
1. Please update the variation swatches plugin to the latest version.
2. Please add this filter code to your child theme’s functions.php -or- use a code snippets plugin to add this filter code.
add_filter(‘cfvsw_is_custom_attr_filter’, function( $default_value, $attribute ){
// Check attribute.
$attribute_name = !empty( $attribute[ 'attribute' ] ) ? $attribute[ 'attribute' ] : '';
// Excluded attributes.
$excluded_attributes = [ "pa_color" ];
if( ! empty( $excluded_attributes ) && in_array( $attribute_name, $excluded_attributes ) ){
return false;
}
return $default_value;}, 10, 2 );
Steps to use the filter –
- Add this filter code to your child theme’s functions.php -or- use a code snippets plugin to add this code
- Add the attribute name you want to exclude in the
$excluded_attributes
array.
How to get the global attribute name? Please refer to this screenshot.
- Go to the WordPress dashboard.
- Click on the product tab pointer 1.
- Click on attribute tab pointer 2.
- In pointer 3 you get the attribute name just add the prefix pa_ on this slug ex – your slug is
color
then your attribute name will be pa_color
How to get a custom attribute name? Please refer to this screenshot.
- Go to the WordPress dashboard click on the product tab and click on all products Pointer 1.
- Chose product.
- Go to the product data section and open the tab Pointer 2.
- Click on attribute Pointer 3.
- Click on custom attribute Pointer 4.
- Here you get the name of the custom attribute you don’t need to add any prefix or suffix on this just copy the name?Pointer 5.
Hope this helps.