Created
May 9, 2025 10:59
-
-
Save tdmrhn/8f19fccbeb874dea93396ee39592349b to your computer and use it in GitHub Desktop.
Blocksy 2 Change Add to Cart Link with Quickview If Out-of-stock or Backorder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_loop_add_to_cart_link', function( $link, $product ) { | |
if ( ! $product->is_in_stock() || $product->is_on_backorder() ) { | |
return '<button class="ct-open-quick-view ct-button" aria-label="Quick view toggle">Backorder Now</button>'; | |
} | |
return $link; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment