How to display Variation Stock Status In WooCommerce Product Variation Dropdown?

Sometimes you want to show Variation Stock Status In Product Variation Dropdown, Like When the customer selects any variation in Dropdown then it will show both variation name and variation stock status. If variation is in stock then it will show “In Stock” otherwise it will show “Out Of Stock”.

Variation Stock Status In WooCommerce Product Variation Dropdown:

Here i am using WooCommerce filter woocommerce_dropdown_variation_attribute_options_html to modify dropdown options value.

Put the below code to your theme functions.php:

Gaurav Kumar

Hi, my name is Gaurav Kumar and I specialize in the Computer Software industry. I have been working as a Software Developer, and it's my passion to learn new things and sharing what I've learned.

Leave a Reply

Your email address will not be published. Required fields are marked *