Answer the question
In order to leave comments, you need to log in
How to use jQuery to check the contents of a table cell and fulfill a condition?
Welcome all!
The essence of the task is as follows:
On the checkout page (woocommerce) , you need to check the name of the product, and if it contains the word Airport , then hide the input id="ticket_number" and show the input id="address".
The product name is displayed:
<td class="product-name">Аэропорт - Центр города</td>
if it can helpAnswer the question
In order to leave comments, you need to log in
Try like this:
<script>
$(function() {
if ($('td.product-name:contains("Аэропорт")').length > 0) {
$('input#ticket_number').hide();
$('input#address').show();
}
});
</script>
</body>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question