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 | |
// Do NOT include the opening php tag. | |
// Disable purchase for non-logged-in users. (Remove add-to-cart button). | |
function m3wc_woocommerce_is_purchasable( $is_purchasable, $product ) { | |
if ( ! is_user_logged_in() ) { | |
return false; | |
} | |
return $is_purchasable; |
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 | |
// Do NOT include the opening php tag. | |
// Set custom price. | |
function m3wc_woocommerce_product_get_price( $price, $product ) { | |
// Do any calculations or conditions here. | |
// For example1: Set a different price for each type of user. | |
// For example2: $price = $price + ( $price * 0.09 ); Adding 9% of the price. |