If-statement in Custom Template
-
Hello,
in my custom template, there is a part of code I would like to only appear for variable products.
I tried to wrap that code like so:<?php <if ( $product->is_type( 'variable' ) ) { printf('<div class="product-description">%s</div>', $item['product']->post->post_excerpt ); } ?>But then I get “Fatal error: Call to a member function is_type() on null”
How can I make this work?
Thank you in advance 🙂
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘If-statement in Custom Template’ is closed to new replies.
