You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WooCommerce产品属性下拉框不显示,无法选择颜色/尺码

Fixing WooCommerce Product Attribute Dropdowns Not Showing

Hey there, the code you shared only removes the Additional Information tab—which has nothing to do with why your product attributes (color/size) are showing as plain text instead of selectable dropdowns. Let’s fix that core issue step by step:

1. Make Sure Your Product is a "Variable Product"

Selectable attribute dropdowns only work with Variable Products (not Simple Products). Here’s how to confirm:

  • Open your product edit page
  • In the top-right Product Data section, ensure the dropdown is set to Variable Product
  • Save the product if you had to adjust this setting

2. Configure Attributes for Variations

You need to mark your attributes as usable for variations so WooCommerce renders them as dropdowns:

  • In the Product Data section, click the Attributes tab
  • For each attribute (Color, Size):
    • Add the attribute (or pick an existing one from the dropdown)
    • Enter your values (e.g., "Small, Medium, Large" for Size)
    • Check the boxes for Used for variations and Visible on the product page
    • Click Save attributes

3. Generate Your Product Variations

Now create the actual selectable variations:

  • Go to the Variations tab in Product Data
  • Click Generate variations (this creates a variation for every attribute combination)
  • For each variation, set price, stock quantity, and any other required details
  • Save all changes

4. Keep the Additional Info Tab Removal (If You Still Want It)

Your existing code to remove the Additional Information tab works perfectly—just add it to your child theme’s functions.php file or a custom plugin:

// Remove additional information tab
add_filter( 'woocommerce_product_tabs', 'remove_additional_information_tab', 100, 1 );
function remove_additional_information_tab( $tabs ) {
    unset($tabs['additional_information']);
    return $tabs;
}

Troubleshooting If Dropdowns Still Don’t Appear

  • Check for Conflicts: Temporarily switch to a default WooCommerce theme (like Storefront) and disable all non-WooCommerce plugins. If dropdowns show up, re-enable items one by one to find the conflicting tool.
  • Double-Check Attribute Settings: Ensure you didn’t uncheck "Visible on the product page" for your attributes in the Attributes tab.

内容的提问来源于stack exchange,提问作者Mahmoud Ahmed

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 08:38:09