How to Mix Dropdowns and Swatches for Better WooCommerce Variations
Content
Many WooCommerce store owners face a common dilemma: they want the visual appeal of swatches for some product attributes (like color) but need the compact efficiency of a dropdown for others (like size or a long list of options). Manually managing this can be frustrating and often leads to a cluttered, inconsistent user experience.
This issue typically arises because WooCommerce's default behavior is to display all variation attributes in the same format, either as dropdowns or, if a plugin is active, as a uniform type of swatch. The need to mix and match formats is a common request to improve both aesthetics and functionality on product pages.
Solution: Using the 'Select' Type for Dropdowns
Based on community discussions and solutions, the 'Variation Swatches for WooCommerce' plugin allows for this mixed display. The key is in how you configure your product attributes within the plugin.
Here is the standard process to achieve a mix of dropdowns and swatches:
- Configure Global Settings: Navigate to WooCommerce → Settings → Products → Variation Swatches for WooCommerce. Here, you can set the default display type for your attributes (e.g., set 'Color' to display as a 'Color' swatch and 'Size' to display as a 'Button').
- Set Specific Attribute Types to 'Select': For any attribute you wish to display as a traditional dropdown, you must ensure its type is set to 'Select'. This setting overrides any global swatch styling and forces that specific attribute to appear as a dropdown menu, while other attributes will display as the swatch type you've chosen for them.
- Verify on the Product Page: After saving your settings, check a variable product that uses these attributes. You should now see a combination of visual swatches and a clean, space-saving dropdown.
This method is effective for creating a more organized product page, especially when dealing with attributes that have a large number of options that would otherwise create an overly long row of buttons.
Alternative: Custom CSS for Advanced Layouts
For users with specific design requirements, such as displaying swatches in multiple columns, custom CSS can be a powerful tool. As seen in one user's solution, adding CSS to your theme (ideally a child theme) can modify the layout.
Example CSS for a grid layout:
.variations tr {
display: grid;
grid: minmax(60px, min-content) / repeat(auto-fill, 180px);
float: left;
}
@media screen and (max-width: 768px) {
.variations tr {
grid: minmax(50px, min-content) / repeat(auto-fill, 140px);
}
.variable-item:not(.radio-variable-item) {
width: 90px;
height: fit-content;
}
}Important: Always test custom code on a staging site first. The exact CSS selectors needed may vary depending on your active theme.
By understanding these configuration options, you can significantly enhance the usability and look of your product variation selections, providing a better experience for your customers.
Related Support Threads Support
-
Show More/Load More Variations as BUTTONhttps://wordpress.org/support/topic/show-more-load-more-variations-as-button/
-
Product image as selectionhttps://wordpress.org/support/topic/product-image-as-selection/
-
Quantity per single producthttps://wordpress.org/support/topic/quantity-per-single-product/
-
How do I show a product in different variations (colours) in the catalogue?https://wordpress.org/support/topic/how-do-i-show-a-product-in-different-variations-colours-in-the-catalogue/
-
Showing variationshttps://wordpress.org/support/topic/showing-variations/
-
WooCommerce Variation Swatcheshttps://wordpress.org/support/topic/woocommerce-variation-swatches/
-
I need your opinionhttps://wordpress.org/support/topic/i-need-your-opinion/
-
Photos for products with 2 variationshttps://wordpress.org/support/topic/photos-for-products-with-2-variations-2/
-
Variation swatches Lightbox on image hoverhttps://wordpress.org/support/topic/variation-swatches-lightbox-on-image-hover/
-
More than 100+ variationshttps://wordpress.org/support/topic/more-than-100-variations/
-
Variations on the picturehttps://wordpress.org/support/topic/variations-on-the-picture/
-
Single Variations Display with Filterhttps://wordpress.org/support/topic/single-variations-display-with-filter/
-
Is it possible to achieve something like this with your pluginhttps://wordpress.org/support/topic/is-it-possible-to-achieve-something-like-this-with-your-plugin/
-
Is it possible to have one product for each color?https://wordpress.org/support/topic/is-it-possible-to-have-one-product-for-each-color/
-
Color Variationshttps://wordpress.org/support/topic/color-variations-3/
-
Color alternating rows on multiple variationshttps://wordpress.org/support/topic/color-alternating-rows-on-multiple-variations/
-
Color combinationhttps://wordpress.org/support/topic/color-combination/
-
Multi sizes and colors on one screenhttps://wordpress.org/support/topic/multi-sizes-and-colors-on-one-screen/
-
how to dropdown + imagehttps://wordpress.org/support/topic/how-to-dropdown-image/
-
how to selectively make variations show as drop downs for one product?https://wordpress.org/support/topic/how-to-selectively-make-variations-show-as-drop-downs-for-one-product/
-
Mix dropdown and swatcheshttps://wordpress.org/support/topic/mix-dropdown-and-swatches/
-
Custom Sizehttps://wordpress.org/support/topic/custom-size-4/
-
Swatches picturehttps://wordpress.org/support/topic/swatches-picture/
-
Gradient and Multi-Color Variationshttps://wordpress.org/support/topic/gradient-and-multi-color-variations/
-
Multiselect imagehttps://wordpress.org/support/topic/multiselect-image/
-
Variation showing in Cart is not the correct colourhttps://wordpress.org/support/topic/variation-showing-in-cart-is-not-the-correct-colour/
-
Can I show all variables in my main page?https://wordpress.org/support/topic/can-i-show-all-variables-in-my-main-page/
-
Product image need to change when selecting two swatcheshttps://wordpress.org/support/topic/product-image-need-to-change-when-selecting-two-swatches/
-
Variation image per color attributehttps://wordpress.org/support/topic/variation-image-per-color-attribute/
-
Show Images from Dropdownhttps://wordpress.org/support/topic/show-images-from-dropdown/
-
Multiple choice on variationshttps://wordpress.org/support/topic/multiple-choice-on-variations/
-
Variations as sinlge productshttps://wordpress.org/support/topic/variations-as-sinlge-products/
-
variation multiple time woocommerce show 3 times the same attributehttps://wordpress.org/support/topic/variation-multiple-time-woocommerce-show-3-times-the-same-attribute/
-
Multiple variation pickhttps://wordpress.org/support/topic/multiple-variation-pick/
-
Images for terms as a dropdown selectionhttps://wordpress.org/support/topic/images-for-terms-as-a-dropdown-selection/
-
issue with variation producthttps://wordpress.org/support/topic/issue-with-variation-product/
-
Variations Attributeshttps://wordpress.org/support/topic/variations-attributes-2/
-
Product Variation displayhttps://wordpress.org/support/topic/product-variation-display-2/
-
2 column possible ?https://wordpress.org/support/topic/2-column-possible/
-
Tiered Variation Grouphttps://wordpress.org/support/topic/tiered-variation-group/
-
“Color” type “Variation Image”https://wordpress.org/support/topic/color-type-variation-image/
-
variation problemhttps://wordpress.org/support/topic/variation-problem-10/
-
Color Variation for “multicolored”https://wordpress.org/support/topic/color-variation-for-multicolored/