• I am trying to make it so that a product that is out of stock on the Shop page does not show a price, but just saying coming soon.

    On a single product page I was able to do this by modifying the class-wc-product.php file. But on the shop page the out of stock product shows up, but it still shows the price. I can’t seem to figure out how I would go about modifying the shop page without effecting every product the shows on the shop page.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    You can filter the prices; https://wordpress.stackexchange.com/questions/83367/how-to-edit-the-get-price-html-on-woocommerce Add some logic there for your stock check.

    Thread Starter theamountof

    (@theamountof)

    It doesn’t seem like we are on the same page. What I am trying to do is have a product that is out of stock show coming soon on the shop page instead of the price.

    I have it so that out of stock products show up on the shop page, I just don’t know how I can make the price say Coming Soon.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    What I suggested is the correct way. Filter price. If product is out of stock, return your new text.

    Thread Starter theamountof

    (@theamountof)

    The answer to the question posed in the link you sharedsaid I could add a filter to:
    return apply_filters('woocommerce_get_price_html', $price, $this);

    The only problem is that get_price_html is not in any of the class-wc-product files. So unless I am looking in the wrong place I do not see where I would go about adding a filter to modify the price shown on the shop page.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Out of Stock/Coming Soon items price on Shop Page’ is closed to new replies.