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
/** | |
* woocommerce_package_rates is a 2.1+ hook | |
*/ | |
add_filter( 'woocommerce_package_rates', 'hide_shipping_when_free_is_available', 10, 2 ); | |
/** | |
* Hide shipping rates when free shipping is available | |
* | |
* @param array $rates Array of rates found for the package | |
* @param array $package The package array/object being shipped |
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
class My_Wc_Cart | |
{ | |
protected $logger; | |
public function __construct() | |
{ | |
$this->logger = new WC_Logger(); | |
add_action('woocommerce_cart_calculate_fees', [$this, 'check_fees'], 10, 1); | |
} |