type: PIN
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
type: PIN
Consumer key: IQKbtAYlXLripLGPWd0HUA
// not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
// BTC Donations to: bc1q0cwjuxxqqmwnxxc0m2xkkyf4kes9e0gejc9u0l | |
/** | |
* Add a .27 surcharge to orders shipping to Colorado | |
*/ | |
add_action('woocommerce_cart_calculate_fees', 'handsome_bearded_guy_custom_surcharge'); | |
function handsome_bearded_guy_custom_surcharge() { | |
global $woocommerce; |
// not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
// BTC Donations to: bc1qc2s60yct2aqza4r7ryweheepd8xa8wqpfgdhg3 | |
/** | |
* Send Custom Price to WooCommerce Google Listings and Ads | |
*/ | |
add_filter( 'woocommerce_gla_product_attribute_value_price', 'handsome_bearded_guy_custom_gla_price' ); | |
function handsome_bearded_guy_custom_gla_price( $price ) { | |
return ( $price * .9 ); | |
} |
// not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
// BTC Donations to: bc1qc2s60yct2aqza4r7ryweheepd8xa8wqpfgdhg3 | |
//hook into wc_ajax_wc_stripe_get_shipping_options | |
add_action( 'wc_ajax_wc_stripe_get_shipping_options', 'handsome_bearded_guy_filter_shipping_methods' ); | |
function handsome_bearded_guy_filter_shipping_methods() { | |
//hook into woocommerce_shipping_methods | |
add_filter( 'woocommerce_shipping_methods', 'handsome_bearded_guy_remove_shipping_methods' ); | |
} |
// not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
// BTC Donations to: bc1qc2s60yct2aqza4r7ryweheepd8xa8wqpfgdhg3 | |
add_filter( 'woocommerce_coupon_get_discount_amount', 'handsome_bearded_guy_coupon_maybe_discount_sign_up_fee_too', 20, 5 ); | |
function handsome_bearded_guy_coupon_maybe_discount_sign_up_fee_too( $discount, $discounting_amount, $item, $single, $coupon ) { | |
if ( 'recurringandsignupdiscount' === $coupon->get_code() && is_callable( array( 'WC_Subscriptions_Product', 'get_sign_up_fee' ) ) ) { | |
$discounting_amount = WC_Subscriptions_Product::get_sign_up_fee( $item['data'] ); | |
$discount_percent = $coupon->get_amount() / 100; | |
$discount = $discounting_amount * $discount_percent; |
add_filter( 'woocommerce_product_get_tax_class', 'big_apple_get_tax_class', 1, 2 ); | |
function big_apple_get_tax_class( $tax_class, $product ) { | |
if ( WC()->cart->subtotal <= 110 ) | |
$tax_class = 'Zero Rate'; | |
return $tax_class; | |
} |
//not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
add_action( 'woocommerce_before_customer_login_form', 'handsome_bearded_guy_jetpack_sso' ); | |
function handsome_bearded_guy_jetpack_sso() { | |
if ( class_exists( 'Jetpack_SSO' ) ) { | |
add_filter( 'jetpack_remove_login_form', '__return_true' ); | |
Jetpack_SSO::get_instance()->login_form(); | |
remove_filter( 'jetpack_remove_login_form', '__return_true' ); | |
} | |
} |
//not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
//BTC Donations to: bc1qc2s60yct2aqza4r7ryweheepd8xa8wqpfgdhg3 | |
add_filter( 'woocommerce_get_availability_text', 'handsome_bearded_guy_availability_text', 10, 2 ); | |
function handsome_bearded_guy_availability_text( $availability, $product ) { | |
$oos_replacement_messages = array(//the product id is the array key and the value is the replacement message | |
3871 => 'Here on Thursday', | |
3870 => 'on back order', | |
); |
//not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
//BTC Donations to: bc1qc2s60yct2aqza4r7ryweheepd8xa8wqpfgdhg3 | |
//Hook into the after checkout validation action, add a callback function named 'validate_no_repeat_purchase' with a priority of 10 and pass two arguments. | |
add_action( 'woocommerce_after_checkout_validation', 'validate_no_repeat_purchase', 10, 2 ); | |
//The callback function accepts the array of posted checkout data and an array of errors | |
function validate_no_repeat_purchase( $data, $errors ) { | |
//extract the posted 'billing_email' and use that as an argument for querying orders. |
#!/usr/local/bin/node | |
//https://www.thathandsomebeardedguy.com/i'd-love-to-❤️-you-more | |
var args = process.argv.slice( 2 )[ 2 ]; | |
var trackId; | |
songURI = args.match( '^.*track:([a-zA-Z0-9]+)' )[ 1 ]; | |
//npm install fs | |
var fs = require( "fs" ); | |
var file = "token.txt"; | |
//npm install scp | |
var scp = require( 'scp' ); |