This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_single_product_summary', 'bbloomer_product_sold_count', 11 ); | |
function bbloomer_product_sold_count() { | |
global $product; | |
$units_sold = $product->get_total_sales(); | |
if ( $units_sold && ( 'yes' === $product->get_meta( '_wc_pre_orders_enabled' ) ) ) echo '<p>' . sprintf( __( 'Units Sold: %s', 'woocommerce' ), $units_sold ) . '</p>'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'woocommerce_email_headers', 'mycustom_headers_filter_function', 10, 2); | |
function mycustom_headers_filter_function( $headers, $object ) { | |
$email = array('new_order', 'new_booking'); | |
if (in_array($object, $email)) { | |
$headers .= 'BCC: Admin <[email protected]>' . "\r\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* set the gifting checkbox to be autochecked */ | |
add_filter('wcsg_recipient_checkbox_checked', '__return_true'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Display all products on one page. | |
*/ | |
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return -1;' ), 20 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Auto check box to update the shipping/billing address on all subscriptions */ | |
add_filter( 'wcs_update_all_subscriptions_addresses_checked', '__return_true' ); | |
/* Auto check box to update the payment method on all subscriptions */ | |
add_filter( 'wcs_update_all_subscriptions_payment_method_checked', '__return_true' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* rename the Membership tab in My account | |
*/ | |
add_filter( 'woocommerce_account_menu_items', 'wcs_rename_membership_my_account', 999 ); | |
function wcs_rename_membership_my_account( $items ) { | |
$items['members-area'] = 'Custom Tab Title'; | |
return $items; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* add the customer to the recipient field for the WooCommerce Failed and Cancelled Order email | |
*/ | |
function wc_cancelled_order_add_customer_email( $recipient, $order ){ | |
return $recipient . ',' . $order->billing_email; | |
} | |
add_filter( 'woocommerce_email_recipient_cancelled_order', 'wc_cancelled_order_add_customer_email', 10, 2 ); | |
add_filter( 'woocommerce_email_recipient_failed_order', 'wc_cancelled_order_add_customer_email', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Adds subscription name, with link to the product page, beside subscription ID in My Account > Subscriptions | |
*/ | |
add_action( 'woocommerce_my_subscriptions_after_subscription_id', 'wcs_add_subscription_name_to_table', 35 ); | |
function wcs_add_subscription_name_to_table( $subscription ) { | |
foreach ( $subscription->get_items() as $item_id => $item ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="1.2.1 - Writing JavaScript in the Browser"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JavaScript for WordPress</title> | |
<style id="jsbin-css"> | |
form { | |
background: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="1.2.10 - Strong v Weak Typing and typeof"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> |
NewerOlder