This file contains hidden or 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
/* | |
* Let's see if I can do dns prefetching correctly | |
*/ | |
add_action('wp_head', 'dns_prefetch'); | |
function dns_prefetch() { | |
echo '<link rel="dns-prefetch" href="//fonts.gstatic.com" />'; | |
echo '<link rel="dns-prefetch" href="//google-analytics.com" />'; | |
echo '<link rel="dns-prefetch" href="//google.com" />'; | |
echo '<link rel="dns-prefetch" href="//stats.g.doubleclick.net" />'; |
This file contains hidden or 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
/** | |
* Redirect user to checkout page directly after adding to cart | |
* | |
* @return string | |
*/ | |
function wc_redirect_to_checkout() { | |
$checkout_url = WC()->cart->get_checkout_url(); | |
return $checkout_url; | |
} |
This file contains hidden or 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 | |
/** | |
* Yvan's child theme functions.php file. You can "move" this child function.php into ANY (<---pretty cool, right?) child theme that you want. | |
* | |
* @package storefront-child | |
*/ | |
// DO NOT REMOVE THIS FUNCTION AS IT LOADS THE PARENT THEME STYLESHEET | |
add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); | |
function enqueue_parent_theme_style() { |
This file contains hidden or 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
// Custom CSS to change Variation Dropdown // | |
.woocommerce div.product form.cart .variations select { | |
width: 190px; | |
float: left; | |
background: -webkit-linear-gradient(top, rgb(255, 255, 255) 0%,rgb(194, 204, 228) 100%); | |
border-radius: 5px; | |
border: 1px solid rgba(0,0,0,0.3); | |
box-shadow: 0 0 5px 1px rgba(0,0,0,0.2), inset 0 1px 0 0px rgba(255,255,255,0.3); | |
margin: 50px; | |
} |
This file contains hidden or 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 | |
function woo_extra_email_recipient($recipient, $object) { | |
$recipient = $recipient . ', [email protected]'; | |
return $recipient; | |
} | |
add_filter( 'woocommerce_low_stock', 'woo_extra_email_recipient', 10, 2); |
This file contains hidden or 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 | |
// THIS IS THE FILE FROM https://gist.github.com/woogist/5692886#file-gistfile1-php// | |
// ...and, believe it or not, I understand about 50% of this.// | |
// While that's better than the average Joe, it' still not enough to actually CONNECT the points // | |
// Anyone want to jump in here? // | |
// Add the action setting | |
add_filter( 'wc_points_rewards_action_settings', 'bkg_sensei_points' ); | |
function points_rewards_newsletter_action_settings( $settings ) { |
This file contains hidden or 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 | |
//======================================================= | |
// Custom Add to Cart Buttons | |
//======================================================= | |
// Display Fields | |
add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' ); | |
// Save Fields | |
add_action( 'woocommerce_process_product_meta', 'woo_add_custom_general_fields_save' ); |
This file contains hidden or 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: Postcode Shipping | |
* Description: This plugin allows you to set a flat shipping rate per country or state or postcode per Quantity/Order on WooCommerce. | |
* Version: 2.1.2 |
This file contains hidden or 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
add_filter('woocommerce_available_shipping_methods','remove_flat_over_twelve',10,1); | |
function remove_flat_over_twelve( $available_methods ) { | |
global $woocommerce; | |
$minimum_flat_rate_quantity = 12; | |
if ( $woocommerce->cart->get_cart_contents_count() >= $minimum_flat_rate_quantity ) { | |
// remove flat_rate shipping | |
unset($available_methods['flat_rate']); | |
} | |
return $available_methods; |