Skip to content

Instantly share code, notes, and snippets.

View meemal's full-sized avatar

Naomi Spirit meemal

View GitHub Profile
@meemal
meemal / hide-all-shipping-keep-local-free.php
Created March 11, 2021 08:31 — forked from bobwol/hide-all-shipping-keep-local-free.php
[General Snippets][Hide other shipping methods, but keep "Local pickup" when “Free Shipping” is available]
/**
* Hide shipping rates when free shipping is available, but keep "Local pickup"
* Updated to support WooCommerce 2.6 Shipping Zones
*/
function hide_shipping_when_free_is_available( $rates, $package ) {
$new_rates = array();
foreach ( $rates as $rate_id => $rate ) {
// Only modify rates if free_shipping is present.
if ( 'free_shipping' === $rate->method_id ) {
@meemal
meemal / eu_cookie_banner.js
Last active May 23, 2018 08:44 — forked from bavington/eu_cookie_banner.js
Simple EU Cookie Law Banner JavaScript