Skip to content

Instantly share code, notes, and snippets.

View scottbuscemi's full-sized avatar

Scott Buscemi scottbuscemi

View GitHub Profile
@scottbuscemi
scottbuscemi / sites.yml
Last active April 3, 2023 22:10
pantheon-wpms-subdomain-map.yml
---
api_version: 1 # Currently only one api version.
# file should be placed in the /private folder
# "domain_maps" is a collection of blog URLs for each environment used to
# facilitate search-replace of a WordPress Multisite (WPMS) across pantheon
# environments. Each key of "domain_maps" must be a valid environment name.
domain_maps:
# environment: <collection of domains to be used on this environment>
# i.e. dev, test, live, feat-branch, &c.
dev:
@scottbuscemi
scottbuscemi / checkout-geo.js
Last active April 5, 2021 22:00
MailChimp for WooCommerce - Automatically uncheck the newsletter signup box for EU customers using Cloudflare geoip
jQuery(document).ready(function( $ ) {
if ($('body').hasClass("eu_customer")) {
$("#mailchimp_woocommerce_newsletter").prop('checked', false);
}
});
@scottbuscemi
scottbuscemi / woo-gist.php
Created July 13, 2016 17:34
WooCommerce minimum order amount for subtotal only (don't include shipping+tax)
// Add to your functions.php file
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 50;
if ( WC()->cart->subtotal < $minimum ) {
@scottbuscemi
scottbuscemi / managewp_cloudflare_love
Created May 10, 2020 01:04
Getting ManageWP to talk nicely to Cloudflare managed sites
# For a domain using Cloudflare's services, go to Firewall > Firewall Rules and follow these steps:
1. Enter a rule name (ie "Managewp")
2. Click "Edit expression"
3. Enter the following into the box:
(ip.src in {34.211.180.66 54.70.65.107 34.210.224.7 52.41.5.108 52.35.72.129 54.191.137.17 35.162.254.253 52.11.12.231 52.11.29.70 52.11.54.161 52.24.142.159 52.25.191.255 52.34.126.117 52.34.254.47 52.35.82.99 52.36.28.80 52.39.177.152 52.41.237.12 52.43.13.71 52.43.76.224 52.88.96.110 52.89.155.51 54.187.92.57 54.191.32.65 54.191.67.23 54.191.80.119 54.191.135.209 54.191.136.176 54.191.148.85 54.191.149.8 52.26.122.21 52.24.187.29 52.89.85.107 54.186.128.167 54.191.40.136 52.88.119.122 52.89.94.121 52.25.116.116 52.88.215.225 54.186.143.184 52.88.197.180 52.27.171.126 34.211.178.241 52.24.232.158 52.26.187.210 52.42.189.119 54.186.244.128 54.71.54.102 34.210.35.214 34.213.77.188 34.218.121.176 52.10.190.191 52.10.225.96 52.11.187.168 52.25.139.76 52.43.127.200 54.191.108.9 54.70.201.228 44.224.174.169 52.32.