Is it possible to implement the same thing than the jQuery code below in PHP?
I use it to hide errors made during importing products from wholesaler.
Here is the jQuery code I use:
jQuery(document).ready(function( $ ){
$('.woocommerce-product-details__short-description:has(p:nth-of-type(2)) p').addClass('ukryj-klase-krotki');
});
How does it work:
jQuery checks if in product short description is more than one <p> element. If there is more - it adds class 'ukryj-klase-krotki' to all <p> elements. Then I add CSS class to hide first <p> element generated in product short description so the only one I want is visible:
CSS code:
.woocommerce-product-details__short-description .ukryj-klase-krotki{
display: none;
}
.woocommerce-product-details__short-description .ukryj-klase-krotki ~ .ukryj-klase-krotki{
display: block;
}
Any help?