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_before_cart_table', 'free_shipping_notice' ); | |
add_action( 'woocommerce_checkout_before_customer_details', 'free_shipping_notice' ); | |
function free_shipping_notice() { | |
if ( 25 > WC()->cart->get_total() ) { | |
echo '<div style="color: #e08e79;">All orders over $25 ship free</div>'; | |
} | |
} |
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 | |
/** | |
* Plugin Name: Fix woocommerce admin analytics performance issue | |
* Plugin URI: | |
* Description: | |
* Version: 1.0.0 | |
* Author: | |
* Author URI: | |
* License: MIT |
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 | |
/* | |
Migrate from WP User Avatar to Simple Local Avatars | |
Allows sites to easily move away from the WP User Avatar plugin and switch to Simple Local Avatars instead. | |
Run by invoking with WP CLI like so: | |
`wp eval-file migrate-wp-user-avatar.php` | |
Author: Philip John |
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
// Use these instructions at your own risk. Make sure you have full site/database backup prior to proceeding. | |
// | |
// Install this plugin to add custom PHP code https://wordpress.org/plugins/code-snippets/ | |
// Activate the plugin. | |
// Go to Snippets->Add New | |
// Paste the following code into the provided "Code" field. | |
// Choose to Run Only Once. | |
// Click Save changes and activate button at the bottom. | |
// After running it once, I would suggest to remove this snippet otherwise you may miss out on important updates in the future. | |
// After running this, you may get a fresh copy of the notices once more. This is normal and this time when you dismiss them, they should stay gone.. |
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_subject_new_order', 'customizing_new_order_subject', 10, 2 ); | |
function customizing_new_order_subject( $formated_subject, $order ) { | |
$email = WC()->mailer->get_emails()['WC_Email_New_Order']; | |
$subject = $email->get_option( 'subject', $email->get_default_subject() ); | |
$product_categories = array(); | |
foreach ( $order->get_items() as $item ) { | |
$product_categories[] = implode( ', ', wp_get_post_terms( $item->get_product_id(), 'product_cat', array( 'fields' => 'names' ) ) ); |
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 | |
// Drop the below in theme functions.php. | |
add_action( 'after_setup_theme', function() { | |
remove_theme_support( 'block-templates' ); | |
} ); |
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 | |
/** | |
* Plugin Name: Limit Orders for WooCommerce - Shortcode | |
* Description: Custom shortcode for displaying information from the Order Limiter. | |
* Author: Nexcess | |
* Author URI: https://nexcess.net | |
*/ | |
use Nexcess\LimitOrders\OrderLimiter; |
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 | |
/** | |
* Plugin Name: Limit Orders for WooCommerce - Prevent Empty Carts | |
* Description: Prevent WooCommerce from emptying carts after the order limit has been reached. | |
* Author: Nexcess | |
* Author URI: https://nexcess.net | |
*/ | |
/** | |
* Prevent WooCommerce from removing non-purchasable items from the cart. |
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 | |
/* | |
Plugin Name: Plugin Autoupdate Filter | |
Plugin URI: https://gist.github.com/NickGreen/a66d349575cf9e78c6dafd92efa5288a/edit | |
Description: Plugin which sets plugin autoupdates to always on, but only happen during specific times. | |
Version: 1.0 | |
Author: Nick Green | |
Author URI: | |
License: GPLv3 | |
*/ |