Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tdmrhn/8f19fccbeb874dea93396ee39592349b to your computer and use it in GitHub Desktop.
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
<?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