I want to write for WooCommerce product features with .. alert and I need help to complete the code
If the user selects a variable from the available product and one of the variables selected by the user is null, I want to show a warning to the user.
`
<?php
// PHP program to pop an alert
// message box on the screen
// Display the alert box
echo '<script>alert("Welcome to Geeks for Geeks")</script>';
?>
`
`
this is my code
2
Answers
I don’t really understand what you mean, maybe this can help you
For example, suppose
We have a product that has an XL size and it has 2 colors, red and blue
We have 2 pieces of blue color in stock
But there are 0 pieces of red in stock
We want to show a message to the user if the user chooses the red size XL, that the stock of this variable in the warehouse is 0.