I've tried several different things, but with no good results. I'm attempting to add an elseif which will allow me to echo "Enquire for Price" instead of a price if left blank on a wordpress.org site that uses Woocommerce. Instead, the price is being shown as 0 or EnquireforPrice£0. Our custom theme doesn't have a price.html or loop.html file, so I can't edit those. The price.html file in single-product (woocommerce folder) shows EnquireforPrice£(whatever the original price was) when I tried to edit it with the elseif I found on this wordpress woocommerce support thread
This is my current code that doesn't allow for enquire for price and for some reason I'm drawing a blank on how to get it to work.
<?php echo ($product->get_stock_quantity() < 1) ? '<span class="sold">Sold</span>' : null; ?><?php if ($product->get_stock_quantity() != 0) : ?><p class="price"><?php echo woocommerce_price(get_post_meta(get_the_ID(), '_price', true)); ?></p><?php endif; ?>
Basically, I need it to say Enquire for price if the price is left blank in the individual product price, but if there is a price to list the price. It should be straight forward, yet for some reason it simply isn't.
Thanks for any help that can be offered!
PS I've also tried the wordpress plugins that are supposed to do this, but they only work on the product page and leave £0 on the home and search pages.