Skip to content

Instantly share code, notes, and snippets.

View BurlesonBrad's full-sized avatar
🎯
Focusing

Brad Griffin BurlesonBrad

🎯
Focusing
View GitHub Profile
@BurlesonBrad
BurlesonBrad / move-proceed-to-checkout
Created October 18, 2015 21:44
Get the friggin' Proceed To Checkout button to the TOP of the page (not the bottom!!)
add_action( 'woocommerce_before_cart', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}
@BurlesonBrad
BurlesonBrad / move-proceed-to-checkout.php
Last active November 28, 2020 17:41
Put Checkout button next to the Update Cart button (AWESOME on mobile!!) https://bradgriffin.me/proceed-to-checkout/
add_action( 'woocommerce_cart_actions', 'move_proceed_button' );
function move_proceed_button( $checkout ) {
echo '<a href="' . esc_url( WC()->cart->get_checkout_url() ) . '" class="checkout-button button alt wc-forward" >' . __( 'Proceed to Checkout', 'woocommerce' ) . '</a>';
}
/* Howdy Steve. See down there where it says 250%? Add this code to your child style.css file */
/* Once you've got this code added, change that number to whatever percentage you think looks good */
.site-header .site-branding img, .site-header .site-logo-anchor img, .site-header .site-logo-link img {
height: auto;
max-width: 250%;
max-height: none;
}
/* End Custom Logo Size */
/* Howdy Paris! Add this to your child functions.php file and it should remove the additional variation number */
function paris_custom_variation_price( $price, $product ) {
$target_product_types = array(
'variable'
);
if ( in_array ( $product->product_type, $target_product_types ) ) {
// if variable product return and empty string
return '';
}
/* Marco, add all this to your child theme's functions.php file */
/* Bye Emoji :-( */
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
/* ...so sad */
/* Lets really optimize this js hooplah */
@BurlesonBrad
BurlesonBrad / Steve's
Created October 28, 2015 21:16
Autocomplete Steve | Steve Completes Me | NO, I AutoComplete Steve
/* I now pronounce you AUTOCOMPLETED. You may take your money! */
add_filter( 'woocommerce_payment_complete_order_status', 'steve_got_hitched_so_autocomplete_virtual_orders', 10, 2 );
function steve_got_hitched_so_autocomplete_virtual_orders( $order_status, $order_id ) {
$order = wc_get_order( $order_id );
if ('processing' == $order_status && ('on-hold' == $order->status || 'pending' == $order->status || 'failed' == $order->status)) {
$virtual_order = '';
@BurlesonBrad
BurlesonBrad / enhance.php
Created October 31, 2015 02:01
Enhancing Woo's StoreFront
<?php
/**
* Welcome screen enhance template
*/
?>
<?php
?>
<div class="col two-col" style="overflow: hidden;">
<div class="col">
@BurlesonBrad
BurlesonBrad / nick
Last active November 13, 2015 08:14
nick
// Begin Speed Tweaks //
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
@BurlesonBrad
BurlesonBrad / wpfixit
Last active November 13, 2015 23:47
wpfixit
add_action( 'wp_dashboard_setup', 'register_my_dashboard_widget' );
function register_my_dashboard_widget() {
wp_add_dashboard_widget(
'my_dashboard_widget',
'WpFixIt Sales At A Glance',
'my_dashboard_widget_display'
);
}
@BurlesonBrad
BurlesonBrad / add-to-cart-with-quantity.php
Created November 17, 2015 21:05
Add To Cart With Quantity
<?php
/**
* Loop Add to Cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {