Skip to content
Advertisement

Change “Read More” button link on Out of stock Woocommerce products

Is it possible to change the Read More button of a out of stock product to redirect to a specific page/url or popup message instead of going to the single product view.

Whenever I have an out of stock product id like to have a popup message appear saying something in a Lightbox window.

Advertisement

Answer

The code below will change the product button link when product is out of stock on Woocommerce archive pages:

JavaScript

Code goes in function.php file of your active child theme (or active theme). Tested and works.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement