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; |
add_filter( 'booking_form_fields', 'handsomebeardedguy_booking_form_fields' ); | |
function handsomebeardedguy_booking_form_fields( $fields ) { | |
if ( isset( $fields['wc_bookings_field_resource'] ) ) { | |
$pattern = '#\(\+*.*\)#'; | |
$replacement = ''; | |
foreach ( $fields['wc_bookings_field_resource']['options'] as $key => $value ) { | |
$fields['wc_bookings_field_resource']['options'][ $key ] = preg_replace( $pattern, $replacement, $value ); | |
} | |
} |
// 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' ); | |
} |
add_action( 'woocommerce_after_my_account', 'handsomebeardedguy_after_my_account' ); | |
add_action( 'woocommerce_subscription_details_after_subscription_table', 'handsomebeardedguy_after_my_account' ); | |
function handsomebeardedguy_after_my_account() { | |
echo '<script> | |
jQuery(document).ready(function($) { | |
$("td.subscription-actions a.cancel, table.shop_table.subscription_details a.cancel").on("click", function(e) { | |
var confirmCancel = confirm("Are you sure you want to cancel this subscription? This action is not reversible") | |
if (!confirmCancel) { | |
e.preventDefault() |
<?php | |
add_action( 'pre_get_posts', 'wwm_pre_get_posts', 10, 0 ); | |
function wwm_pre_get_posts() { | |
/** | |
* For this example, the plugin that would be altered is the 'featured video plus' plugin | |
* The task is to show the featured video on single pages, but not on archives | |
* apply the filter on singlular pages that aren't the admin interface. | |
*/ |
add_action( 'woocommerce_loaded', 'handsome_bearded_guy_wc_loaded' ); | |
function handsome_bearded_guy_wc_loaded() { | |
$old_statuses = array( | |
'failed', | |
//uncomment any of the below statuses to include those statuses | |
//'pending', | |
//'processing', | |
//'on-hold', | |
//'cancelled', |
//not sure what to do with this code snippet? See https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/ | |
add_filter( 'woocommerce_add_to_cart_sold_individually_found_in_cart', 'handsome_bearded_guy_maybe_redirect_to_cart' ); | |
function handsome_bearded_guy_maybe_redirect_to_cart( $found_in_cart ) { | |
if ( $found_in_cart ) { | |
wp_safe_redirect( wc_get_page_permalink( 'cart' ) ); | |
exit; | |
} |
// 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 ); | |
} |