Get product type (check is it "external") for further action
I’m trying set the condition in the header in my template. When customer enter the product page and the product type is “external”, then some block appears in header.
Here’s how I tried to implement it (the code goes right after <body> tag in header.php):
<?php global $product; if (is_product() and $product->product_type == 'external') : ?> <div>Some info for external products</div> <?php endif; ?>
But it doesn’t work. Can somebody help me whith this issue? I’m not familiar with wordpress so good and can be some stupid mistake in my code.
Thanks in advance.
- The topic ‘Get product type (check is it "external") for further action’ is closed to new replies.