Skip to content

Instantly share code, notes, and snippets.

@jessepearson
jessepearson / wc_auto_complete_virtual.php
Created July 4, 2016 20:38
Auto Complete all WooCommerce virtual orders
<?php // only copy this line if needed
/**
* Auto Complete all WooCommerce virtual orders.
*
* @param int $order_id The order ID to check
* @return void
*/
function custom_woocommerce_auto_complete_virtual_orders( $order_id ) {
@ddemuth
ddemuth / woocommerce-custom-email-recipient.php
Last active January 30, 2021 21:42
Customize the email recipient
//WooCommerce Email Customizations
add_filter( 'woocommerce_email_recipient_customer_note', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_completed_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_invoice', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
add_filter( 'woocommerce_email_recipient_customer_processing_order', array( $this, 'fka_parent_email_recipient_filter_function' ), 10, 2);
/**
* $recipient could be comma separated to send to additional people
* EX. $recipient .= ', $additonal_recipient';
*/
@BenMorel
BenMorel / viewport-units-ios.scss
Last active March 11, 2022 13:15
SCSS mixin to support vh and vw units on all iOS Safari versions. Based on an idea by Patrick Burtchaell's: https://gist.github.com/pburtchaell/e702f441ba9b3f76f587
/**
* Fix for vw, vh, vmin, vmax on iOS 7.
* http://caniuse.com/#feat=viewport-units
*
* This fix works by replacing viewport units with px values on known screen sizes.
*
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix.
* Target devices running iOS 8+ will incidentally execute the media query,
* but this will still produce the expected result; so this is not a problem.
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/