I'm new so if I goof in how I post, please guide me... also am not a programmer... I tried the code given in two other threads but it didn't quite do the trick. I understood by the documentation that I was not to seek clarification on those threads, so I hope it's ok that I'm opening a new one...
Website: www.leannacinquanta.com/shop, Woocommerce plugin latest version. When I inserted the following two code snippets into the Custom CSS area in my premium Wp theme "X Theme" it did not result in any change to my shopping cart. I would deeply appreciate your assistance:
/*WOOCOMMERCE hide"calculate shipping"*/
add_filter('woocommerce_product_needs_shipping', function(){return false;});
/*WOOCOMMERCE remove Flat Rate from view when order is over $50 which qualifies for free shipping */
add_filter('woocommerce_package_rates', 'hide_flat_rate_based_on_cart_total', 10, 3);
function hide_flat_rate_based_on_cart_total( $available_shipping_methods, $package ){
$price_limit = 50;
if( WC()->cart->get_total() > $price_limit ){
foreach($available_shipping_methods as $method_key => $method){
if ( strpos($method->method_id, 'flat_rate' ) !== false) {
unset($available_shipping_methods[$method_key]);
}
}
}
return $available_shipping_methods;
}