Magento 2.2如何将视图页产品属性(含可配置产品尺寸)设为下拉菜单?
Hey there! Good news—this is totally doable with Magento 2.2's built-in tools, no third-party extensions needed. Here's a step-by-step walkthrough to get this set up:
- Access the Attribute Management Panel: Log into your Magento admin dashboard, then navigate to
Stores > Attributes > Product. Locate the attribute you want to convert (e.g., "Product size") and click its name to edit. - Set Input Type to Dropdown: In the attribute's edit page, under the Properties tab, find the Catalog Input Type for Store Owner field. Select Dropdown from the dropdown options.
- Enable for Configurable Products: Still in the Properties tab, scroll down to the Advanced Attribute Properties section and ensure the Use in Configurable Product option is set to Yes. This lets the attribute be used to create configurable product variations.
- Add Attribute Options (if missing): Switch to the Manage Options tab. If you haven't already, add all the options you want in the dropdown (e.g., S, M, L, XL) by clicking Add Option, filling in the values for each store view, then saving the attribute.
- Verify Attribute Set Association: Head to
Stores > Attributes > Attribute Set. Find the attribute set your configurable product uses (e.g., "Default"), then drag your size attribute from the Unassigned Attributes column to the appropriate group (e.g., "Product Details") in the right pane. Save the attribute set. - Update Your Configurable Product: Go to
Products > Catalog, find your target configurable product, and click Edit. Navigate to the Configurations tab, then click Create Configurations (if you haven't set up variations yet) or Edit Configurations to re-associate the dropdown attribute. Follow the wizard to select your size attribute and map it to the corresponding simple products, then save the product. - Flush Cache to Apply Changes: Finally, go to
System > Cache Management, select all cache types, choose Flush Magento Cache from the dropdown, and click Submit. If you have SSH access, you can also run the commandbin/magento cache:flushdirectly from your server terminal for faster results.
A quick note: If you don't see the dropdown change on the frontend right away, clear your browser cache or do a hard refresh (Ctrl+F5) to load the updated content.
内容的提问来源于stack exchange,提问作者Paul Kendal
相关产品推荐
相关产品推荐

