If WooCommerce Product Out Of Stock, Show Widget

This code enables you to display a widget area if your single product is out of stock. You can display the widget in any WooCommerce single product page hook position.

In this example, we’ll use the the woocommerce_before_single_product hook.

Here’s the code you can add copy ( without the opening PHP tag ) to your child themes functions.php file.

Note : You will need to swap out both instances of the text-domain with the text-domain for your theme. You can find the text domain in your style.css file header.

In this example, the text-domain should be changed to genesis-sample. However, the PHP code will work in any WordPress theme and is NOT coded with Genesis widget functions.

Download Folder

Was This Tutorial Helpful?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.