Created
October 18, 2018 08:44
-
-
Save plugin-republic/6d2594f71dba101186b22797dfab835a to your computer and use it in GitHub Desktop.
This file contains 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 | |
/** | |
* Prevent products being purchased from archive | |
* @return Boolean | |
*/ | |
function pewc_filter_is_purchasable( $is_purchasable, $product ) { | |
if( is_archive() ) { | |
return false; | |
} | |
return $is_purchasable; | |
} | |
add_filter( 'woocommerce_is_purchasable', 'pewc_filter_is_purchasable', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment