Skip to content

Instantly share code, notes, and snippets.

@KoolPal
KoolPal / mr_wc_new_order_email_recipient.php
Created March 6, 2023 04:43 — forked from monecchi/mr_wc_new_order_email_recipient.php
WooCommerce New Order Email to different recipient based on customer's city
/**
* Add another email recipient for admin New Order emails if a shippable product is ordered for a specific city
*
* @param string $recipient a comma-separated string of email recipients (will turn into an array after this filter!)
* @param \WC_Order $order the order object for which the email is sent
* @return string $recipient the updated list of email recipients
*/
function mr_wc_conditional_email_recipient( $recipient, $order ) {
// Bail on WC settings pages since the order object isn't yet set yet
// Not sure why this is even a thing, but shikata ga nai
@KoolPal
KoolPal / wc-add-bcc-to-emails-with-yith.php
Created June 13, 2020 06:15 — forked from damiencarbery/wc-add-bcc-to-emails-with-yith.php
Add BCC to WooCommerce emails - Add an email address (or two) as BCC to all WooCommerce emails. https://www.damiencarbery.com/2020/03/add-bcc-to-woocommerce-emails/
<?php
/*
Plugin Name: Add BCC to WooCommerce emails (with YITH)
Plugin URI: https://www.damiencarbery.com/2020/03/add-bcc-to-woocommerce-emails/
Description: Add an email address as BCC to all WooCommerce emails. Updated for when YITH Request a Quote installed.
Author: Damien Carbery
Author URI: https://www.damiencarbery.com
Version: 0.1
*/
<?php
if ( ! function_exists( 'de_woo_email_social_icons' ) ) {
function de_woo_email_social_icons( $icons ) {
echo '<ul class="de-social-icons">
<li><a href="#" target="_blank"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-linkedin" aria-hidden="true"></i></a></li>
<li><a href="#" target="_blank"><i class="fa fa-instagram" aria-hidden="true"></i></a></li>
</ul>
@KoolPal
KoolPal / WordPress Performance.txt
Created April 21, 2020 12:40 — forked from ankyit/WordPress Performance.txt
WordPress Performance
### Sites:
https://gtmetrix.com/
https://developers.google.com/speed/pagespeed/insights/
### Plugins
https://wordpress.org/plugins/query-monitor/
https://wordpress.org/plugins/autoptimize/
https://wordpress.org/plugins/wp-super-cache/
https://wordpress.org/plugins/ewww-image-optimizer/
https://wordpress.org/plugins/jetpack/
@KoolPal
KoolPal / cf-wp-cache-worker.js
Created April 21, 2020 12:39 — forked from brandomeniconi/cf-wp-cache-worker.js
Basic Cloudflare Worker that allows efficient page caching for Wordpress websites
// Version 1.4
const DAY_IN_SECONDS = 60*60*24;
const BLACKLISTED_URL_PARAMS = [
'fbclid', // Google Ads click Id
'gclid', // Facebook click Id
'msclkid', // Micorosft Ads Click Id
];
addEventListener('fetch', event => {
@KoolPal
KoolPal / wc-csv-import-disable-customer-change-emails.php
Created March 31, 2020 03:55 — forked from tamarazuk/wc-csv-import-disable-customer-change-emails.php
WooCommerce CSV Import - Disable WP user email/password change emails
<?php // only copy this line if needed
add_filter( 'send_password_change_email', '__return_false' );
add_filter( 'send_email_change_email', '__return_false' );
@KoolPal
KoolPal / wc-custom-order-action-sample.php
Created March 31, 2020 03:53 — forked from bekarice/wc-custom-order-action-sample.php
Add a WooCommerce custom order action
<?php // only copy if needed
/**
* Add a custom action to order actions select box on edit order page
* Only added for paid orders that haven't fired this action yet
*
* @param array $actions order actions array to display
* @return array - updated actions
*/
function sv_wc_add_order_meta_box_action( $actions ) {
@KoolPal
KoolPal / disable-woocommerce-admin.php
Created March 29, 2020 14:42 — forked from joshuatf/disable-woocommerce-admin.php
A plugin to disable the new WooCommerce Admin package in WooCommerce
<?php
/**
* Plugin Name: Disable WooCommerce Admin
* Description: This plugin disables the new WooCommerce Admin package in WooCommerce.
* Version: 1.0
*/
add_filter( 'woocommerce_admin_disabled', '__return_true' );
@KoolPal
KoolPal / style.css
Created March 17, 2020 13:03 — forked from Frisoni/style.css
Flatsome testimonial customization
/* Flatsome testimonial customization */
.testimonial-box {
margin-bottom: 50px;
border-radius: 7px;
-webkit-box-shadow: 0px 0px 10px 3px rgba(225,225,225,0.75);
-moz-box-shadow: 0px 0px 10px 3px rgba(225,225,225,0.75);
box-shadow: 0px 0px 10px 3px rgba(225,225,225,0.75);
}
.testimonial-box .testimonial-image {
top: -50px;
@KoolPal
KoolPal / CSS
Created March 17, 2020 13:03 — forked from jerrickhakim/CSS
Flatsome Fancy Icon Nav
/* SIDE NAV CSS DESKTOP */
.mfp-content {
width: 30% !important;
/* OPTION TO MAKE NAV TRANSPARENT */
/* DELETE OR TURN TO 1 IF YOU DONT WANT THE MENU TO BE TRANSPARENT */
opacity: 0.95 !important;
}
li.html.custom.html_nav_position_text {
padding: 0px;
}