p13patch
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [WooCommerce] How to Set Up Free Shipping for Orders Over $100?This is the code I was working with to hook into the shipping functionality of WooCommerce:
function hide_free_shipping_if_order_total_less_than_100( $rates, $package ) {
// Set the minimum order total for free shipping
$minimum_order_total = 100;
// Get the cart subtotal (without shipping and taxes)
$cart_subtotal = WC()->cart->subtotal;
// Debugging to check cart subtotal
error_log( 'Cart Subtotal: ' . $cart_subtotal );
// Check if the cart subtotal is less than the minimum required
if ( floatval( $cart_subtotal ) < $minimum_order_total ) {
// Debugging to confirm threshold check
error_log( 'Removing free shipping as cart total is below ' . $minimum_order_total );
// Loop through the shipping rates
foreach ( $rates as $rate_key => $rate ) {
// Check if the current rate is 'free_shipping'
if ( 'free_shipping' === $rate->method_id ) {
// Debugging to confirm rate removal
error_log( 'Removing free shipping method: ' . $rate_key );
// Remove the free shipping option
unset( $rates[ $rate_key ] );
}
}
}
return $rates;
}
add_filter( 'woocommerce_package_rates', 'hide_free_shipping_if_order_total_less_than_100', 10, 2 );Forum: Plugins
In reply to: [Contact Form 7] Email field is ‘invalid’ even when correctly filled outThat’s weird, it is still showing errors when I fill it out. Do you think it is a caching issue?
Yes, I deleted your plugin, and had it happen again, so it wasn’t yours that did it. (the timing of when it happened was right after I downloaded and activated your plugin, which is why I made that assumption). Is there a way for me to just delete this whole review?
I was able to get it switched back, and the page is working again. Thanks for the offer.
Viewing 4 replies - 1 through 4 (of 4 total)