I've search the interwebs high and low looking for a way to conditionally display WooCommerce product attribute data on certain pages.
Ex: if attribute somethingcool has a value and it's on /?filtering=1&filter_manufacturer=1648 page, display value
I'd like to display an attribute differently if they are on a specific filtered page
Based on this filtered page, display a product attribute 'somethingcool'
<?php if ( is_product_attribute('somethingcool') ) {
echo 'Hi! This is something cool?';}
else {
echo '';
}
?>
If it were a normal WordPress page, not a filtered page I could hide and show based on body class tag but unfortunately the body class doesn't change based on query string urls.
Aucun commentaire:
Enregistrer un commentaire