• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Try Premium
  • Log in

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

WooCommerce

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.