You can use product attributes. You can configure them in the back-end, and then add something like this to your template:
<?php $sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are available ?>
<span class="product-size-label">Choose your size:</span>
<select class="product-size">
<?php foreach($sizes as $size){ ?>
<option><?php echo $size; ?></option>
<?php } ?>
</select>
<?php } ?>
However, if it affects the price or appearance of your products, you have to use product variations. That’s what they were designed for. As far as plugins go, I haven’t tried any of them but it looks like there’s a few that could achieve that fucntionality, e.g. this one.
Related Posts:
- Display single product attribute value on Shop page (Woocommerce)
- Get product details by url key in WordPress woocommerce
- Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?
- Extend Woocommerce rest api routes fails
- woocommerce_before_calculate_totals in woocommerce 3.0
- How to get all attributes with their terms related to specific Woocommerce product category [closed]
- Remove “Choose An Option” on Product Variation & Auto Select Instead
- why featured product not updated in postmeta table in woocommerce?
- Programmatically adding product attributes to WP / Woo commerce
- Woocommerce custom search
- Get product variation attribute titles – WooCommerce
- How to change Attribute Type
- WooCommerce – buying as well as selling
- Is it possible to merge Woocommerce attributes? [closed]
- Best Practice – Customise a WooCommerce+WordPress Templates
- WooCommerce: One term for Many Product Attributes
- How to remove product attribute row woocommerce using code
- Woocommerce: Any way to list all products *without* a specific attribute?
- How to add product variations for large number of products in WooCommerce?
- WooCommerce: how to set stock per attribute on variable product
- Importing Attributes in to Woocommerce
- Woocommerce: Some action hooks not firing inside class [closed]
- Is it possible Different templates of products for specific category in WooCommerce?
- WooCommerce – Adding Product Attributes to CSV Export
- WordPress and WooCommerce How to Assign Attribute Based Pricing
- Create templates from attributes for categories
- Pass custom Checkout field value to Stripe gateway in WooCommerce
- woocommerce fail to replace template string in email title [closed]
- WooCommerce Shop Page Not Found 404
- How can I show an empty WooCommerce cart? [closed]
- Woocommerce Pre Orders – Can i override templates?
- redirect product-category to a custom page
- Woocommerce checkout via external page [closed]
- Change font size in products listing pages in woocommerce
- Set quantity of woocommerce product on page visit [closed]
- Display File Types For Woocommerce Downloadable Products On Product Page
- How to redirect WooCommerce shop URL?
- Trying to disable slider for WooCommerce price filter [closed]
- Programmatically setting Woocommerce product price
- Woocommerce reviews xss issue [closed]
- Add product categories to receipt
- Woocommerce specific product template for product type
- How can I use a gravity form to send an e-card?
- How to select default Woocommerce category page
- Creating Product Table using Gutenberg
- I can ‘t display product images based on the label
- SKU for each product on every page
- Woocommerce get billing state manually
- Woocommerce Cart Default Language Not Changing
- Make this Fast and Queryable
- WooCommerce slider filter for numerical attributes
- Woocommerce Update Causing Internal Server Error [closed]
- Reordering product tab under product image [closed]
- How do I change the default state label for a country on the WooCommerce checkout page?
- remove default pagination on woocommerce shop page
- woocommerce – customise notice error in checkout page
- Woocommerce, prevent login after registration and redirect to custom URL
- How to add product filter dropdown in woo commerce order page?
- Unable to paste google analytics con header.php [closed]
- how to scrolling image on single product page
- How to display WooCommerce product tag names on home and category pages
- Specifically Link To the “Leave a review” part of product page? [closed]
- Woocommerce pre_get_posts query variation meta data not working
- Can’t hide product attributes with css on WooCommerce Product Page
- Updating product image
- Split in 2 columns add to cart button and variable forms
- Images not uploading on product page of woocommercr
- How to access WC()->cart in CF7 hook wpcf7_special_mail_tags
- woocommerce remove coupon link does not work
- How to integrate e-transfers with checkout in WooCommerce
- Woocommerce to get restaurant table numbers in the checkout fields from the url
- Send all emails to Shop Manager along with admin
- UX Builder not loading for product description edits
- I need help with storefront theme shop page
- Woocommerce shop page not showing all products
- Wrong Billing Information in WC_Checkout->get_checkout_fields(‘billing’)?
- How to display two different custom taxonomy terms on a WooCommerce single product page
- Registration roles
- Sending billing details via POST request to an API
- how can my customers view their purchased products history like an invoice in a specific page on WordPress
- How do I make my products on the homepage responsive?
- Tax exclusive if coupon applied else tax inclusive in items
- WooCommerce Registration, Sync User, Billing and Shipping info
- How to customize product at cart page
- WooCommerce Storefront site-header padding
- How to check which shortcode is using my template?
- woocommerce: when adding or removing items to cart , it takes cart a few seconds to read changes?
- How to get woocommerce integration instance?
- Create woocommerce order on new user registration
- How to put a date range in a virtual/downloadable product? [closed]
- When to use a child theme for WooCommerce Storefront?
- Redirect whole website or pages to /wp-admin in wordpress
- Changing sale price programmatically, but it’s not shown on front-end
- Woocommerce shows empty columns [closed]
- Product atributes in title of order (not in description)
- How to create custome pdf file of my invioice in wordpress
- How to get sub items of parent menu item?
- Storefront Child Theme show product attribute [closed]
- Adding a column to woocomerce admin order page that can be sorted
- Auto generating API keys using the Application Authentication Endpoint [closed]